mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 22:53:55 +08:00
* improve devcontainer tests
* test full build with cache
* fix that
* fix the cache
* fix the cache
old-commit-hash: 003018fc46
30 lines
825 B
Bash
Executable File
30 lines
825 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# pull base image
|
|
if [[ -z $USE_LOCAL_IMAGE ]]; then
|
|
docker pull ghcr.io/commaai/openpilot-base:latest
|
|
fi
|
|
|
|
# setup .host dir
|
|
mkdir -p .devcontainer/.host
|
|
|
|
# setup links to Xauthority
|
|
XAUTHORITY_LINK=".devcontainer/.host/.Xauthority"
|
|
rm -f $XAUTHORITY_LINK
|
|
if [[ -z $XAUTHORITY ]]; then
|
|
echo "XAUTHORITY not set. Fallback to ~/.Xauthority ..."
|
|
if ! [[ -f $HOME/.Xauthority ]]; then
|
|
echo "~/.XAuthority file does not exist. GUI tools may not work properly."
|
|
touch $XAUTHORITY_LINK # dummy file to satisfy container volume mount
|
|
else
|
|
ln -sf $HOME/.Xauthority $XAUTHORITY_LINK
|
|
fi
|
|
else
|
|
ln -sf $XAUTHORITY $XAUTHORITY_LINK
|
|
fi
|
|
|
|
# setup host env file
|
|
HOST_INFO_FILE=".devcontainer/.host/.env"
|
|
SYSTEM=$(uname -s | tr '[:upper:]' '[:lower:]')
|
|
echo "HOST_OS=\"$SYSTEM\"" > $HOST_INFO_FILE
|