From fad88e6f86d1dd32cf01db2287df9c63e66c5116 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 22 Nov 2019 13:58:53 -0500 Subject: ci: Remove use of cd --- ci/test/04_install.sh | 6 ++++-- ci/test/06_script_a.sh | 16 ++-------------- ci/test/06_script_b.sh | 5 ----- 3 files changed, 6 insertions(+), 21 deletions(-) (limited to 'ci/test') diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 20e7ad4a14..2a1983b1c5 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -44,6 +44,8 @@ elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (A DOCKER_ADMIN="--cap-add SYS_PTRACE" fi +export P_CI_DIR="$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" @@ -57,12 +59,12 @@ if [ -z "$RUN_CI_ON_HOST" ]; then $DOCKER_NAME_TAG) DOCKER_EXEC () { - docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*" + docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*" } else echo "Running on host system without docker wrapper" DOCKER_EXEC () { - bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*" + bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*" } fi diff --git a/ci/test/06_script_a.sh b/ci/test/06_script_a.sh index b70ef47a47..98b75d7497 100755 --- a/ci/test/06_script_a.sh +++ b/ci/test/06_script_a.sh @@ -19,14 +19,8 @@ else fi END_FOLD -# Create folder on host and docker, so that `cd` works -mkdir -p build DOCKER_EXEC mkdir -p build - -# Temporarily disable errexit, because Travis macOS fails without error message -set +o errexit -cd build || (echo "could not enter build directory"; exit 1) -set -o errexit +export P_CI_DIR="$P_CI_DIR/build" BEGIN_FOLD configure DOCKER_EXEC ../configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (DOCKER_EXEC cat config.log) && false) @@ -38,9 +32,7 @@ mkdir -p "bitcoin-$HOST" DOCKER_EXEC make distdir VERSION=$HOST END_FOLD -set +o errexit -cd "bitcoin-$HOST" || (echo "could not enter distdir bitcoin-$HOST"; exit 1) -set -o errexit +export P_CI_DIR="$P_CI_DIR/bitcoin-$HOST" BEGIN_FOLD configure DOCKER_EXEC ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (DOCKER_EXEC cat config.log) && false) @@ -52,7 +44,3 @@ trap 'DOCKER_EXEC "cat ${BASE_SCRATCH_DIR}/sanitizer-output/* 2> /dev/null"' ERR BEGIN_FOLD build DOCKER_EXEC make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && DOCKER_EXEC make $GOAL V=1 ; false ) END_FOLD - -set +o errexit -cd ${BASE_ROOT_DIR} || (echo "could not enter base root dir $BASE_ROOT_DIR"; exit 1) -set -o errexit diff --git a/ci/test/06_script_b.sh b/ci/test/06_script_b.sh index 23de2f7062..a8e0a50f36 100755 --- a/ci/test/06_script_b.sh +++ b/ci/test/06_script_b.sh @@ -6,11 +6,6 @@ export LC_ALL=C.UTF-8 -# Temporarily disable errexit, because Travis macOS fails without error message -set +o errexit -cd "build/bitcoin-$HOST" || (echo "could not enter distdir build/bitcoin-$HOST"; exit 1) -set -o errexit - if [ -n "$QEMU_USER_CMD" ]; then BEGIN_FOLD wrap-qemu echo "Prepare to run functional tests for HOST=$HOST" -- cgit v1.2.3