aboutsummaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-08-11 11:57:21 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-08-15 11:13:09 -0400
commitfa6cbdc3c9ab42b7e55c666e83b4b8d5545bb745 (patch)
tree88af70a7a52622aa18c670d9ea4337201a2333e9 /ci
parentfa31bc35eb8dd7e727e3e1eaf2c45017cd63bdcb (diff)
downloadbitcoin-fa6cbdc3c9ab42b7e55c666e83b4b8d5545bb745.tar.xz
ci: Use ./ci/ on non-travis host
Diffstat (limited to 'ci')
-rwxr-xr-xci/test/03_before_install.sh1
-rwxr-xr-xci/test/04_install.sh27
2 files changed, 18 insertions, 10 deletions
diff --git a/ci/test/03_before_install.sh b/ci/test/03_before_install.sh
index 3c9fcf3f98..5086114ba1 100755
--- a/ci/test/03_before_install.sh
+++ b/ci/test/03_before_install.sh
@@ -6,7 +6,6 @@
export LC_ALL=C.UTF-8
-PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
# Add llvm-symbolizer directory to PATH. Needed to get symbolized stack traces from the sanitizers.
PATH=$PATH:/usr/lib/llvm-6.0/bin/
export PATH
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