diff --git a/containers/buildkite-linux/entrypoint.sh b/containers/buildkite-linux/entrypoint.sh index a0a3b6a..e2d58d5 100755 --- a/containers/buildkite-linux/entrypoint.sh +++ b/containers/buildkite-linux/entrypoint.sh @@ -32,7 +32,7 @@ rm -rf "$SCCACHE_DIR" mkdir -p "${SCCACHE_DIR}" chown -R ${USER}:${USER} "${SCCACHE_DIR}" chmod oug+rw "${SCCACHE_DIR}" -gosu "$USER" bash -c 'env; whoami; SCCACHE_DIR="${SCCACHE_DIR}" SCCACHE_IDLE_TIMEOUT=0 SCCACHE_CACHE_SIZE=20G sccache --start-server' +gosu "$USER" bash -c 'SCCACHE_DIR="${SCCACHE_DIR}" SCCACHE_IDLE_TIMEOUT=0 SCCACHE_CACHE_SIZE=20G sccache --start-server' # /mnt/ssh should contain known_hosts, id_rsa and id_rsa.pub . mkdir -p /var/lib/buildkite-agent/.ssh diff --git a/containers/buildkite-linux/pre-checkout b/containers/buildkite-linux/pre-checkout index b25b751..307ff75 100755 --- a/containers/buildkite-linux/pre-checkout +++ b/containers/buildkite-linux/pre-checkout @@ -26,7 +26,7 @@ gc_counter="$BUILDKITE_BUILD_PATH/git_gc_counter" echo "BUILDKITE_REPO: $BUILDKITE_REPO" if [ -d "$BUILDKITE_BUILD_CHECKOUT_PATH" ]; then cd "$BUILDKITE_BUILD_CHECKOUT_PATH" || exit - remoteUrl=$(git remote get-url origin) + remoteUrl=$(git remote get-url origin || echo "not a git repo") echo "current remote URL: $remoteUrl" if [ "$remoteUrl" != "$BUILDKITE_REPO" ]; then echo "Remote URL does not match. Deleting and recreating the directory." diff --git a/containers/buildkite-windows/pre-checkout.sh b/containers/buildkite-windows/pre-checkout.sh index 5318cc3..867eeaf 100644 --- a/containers/buildkite-windows/pre-checkout.sh +++ b/containers/buildkite-windows/pre-checkout.sh @@ -16,7 +16,7 @@ ps aux | grep "$BUILDKITE_BUILD_CHECKOUT_PATH" echo "BUILDKITE_REPO: $BUILDKITE_REPO" if [ -d "$BUILDKITE_BUILD_CHECKOUT_PATH" ]; then cd "$BUILDKITE_BUILD_CHECKOUT_PATH" || exit - remoteUrl=$(git remote get-url origin) + remoteUrl=$(git remote get-url origin || echo "not a git repo") echo "current remote URL: $remoteUrl" if [ "$remoteUrl" != "$BUILDKITE_REPO" ]; then echo "Remote URL does not match. Deleting and recreating the directory."