diff options
Diffstat (limited to 'ci/test/04_install.sh')
-rwxr-xr-x | ci/test/04_install.sh | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 2230f5c8eb..3535746e83 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -6,13 +6,8 @@ export LC_ALL=C.UTF-8 -free -m -h -echo "Number of CPUs (nproc): $(nproc)" - ccache echo "Creating ccache dir if it didn't already exist" -${CI_RETRY_EXE} docker pull "$DOCKER_NAME_TAG" - if [ ! -d ${DIR_QA_ASSETS} ]; then git clone https://github.com/bitcoin-core/qa-assets ${DIR_QA_ASSETS} fi @@ -29,11 +24,25 @@ if [[ $HOST = *-mingw32 ]]; then elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764) DOCKER_ADMIN="--cap-add SYS_PTRACE" fi -DOCKER_ID=$(docker run $DOCKER_ADMIN -idt --mount type=bind,src=$BASE_BUILD_DIR,dst=$BASE_BUILD_DIR --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR -w $BASE_BUILD_DIR --env-file /tmp/env $DOCKER_NAME_TAG) -DOCKER_EXEC () { - docker exec $DOCKER_ID bash -c "cd $PWD && $*" -} +if [ -z "$RUN_CI_ON_HOST" ]; then + echo "Creating $DOCKER_NAME_TAG container to run in" + ${CI_RETRY_EXE} docker pull "$DOCKER_NAME_TAG" + + DOCKER_ID=$(docker run $DOCKER_ADMIN -idt --mount type=bind,src=$BASE_BUILD_DIR,dst=$BASE_BUILD_DIR --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR -w $BASE_BUILD_DIR --env-file /tmp/env $DOCKER_NAME_TAG) + + DOCKER_EXEC () { + docker exec $DOCKER_ID bash -c "cd $PWD && $*" + } +else + echo "Running on host system without docker wrapper" + DOCKER_EXEC () { + bash -c "cd $PWD && $*" + } +fi + +DOCKER_EXEC free -m -h +DOCKER_EXEC echo "Number of CPUs \(nproc\): $(nproc)" ${CI_RETRY_EXE} DOCKER_EXEC apt-get update ${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES $DOCKER_PACKAGES |