Skip to content

Commit fad88e6

Browse files
author
MarcoFalke
committed
ci: Remove use of cd
1 parent fa2941b commit fad88e6

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

ci/test/04_install.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (A
4444
DOCKER_ADMIN="--cap-add SYS_PTRACE"
4545
fi
4646

47+
export P_CI_DIR="$PWD"
48+
4749
if [ -z "$RUN_CI_ON_HOST" ]; then
4850
echo "Creating $DOCKER_NAME_TAG container to run in"
4951
${CI_RETRY_EXE} docker pull "$DOCKER_NAME_TAG"
@@ -57,12 +59,12 @@ if [ -z "$RUN_CI_ON_HOST" ]; then
5759
$DOCKER_NAME_TAG)
5860

5961
DOCKER_EXEC () {
60-
docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*"
62+
docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*"
6163
}
6264
else
6365
echo "Running on host system without docker wrapper"
6466
DOCKER_EXEC () {
65-
bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $PWD && $*"
67+
bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*"
6668
}
6769
fi
6870

ci/test/06_script_a.sh

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,8 @@ else
1919
fi
2020
END_FOLD
2121

22-
# Create folder on host and docker, so that `cd` works
23-
mkdir -p build
2422
DOCKER_EXEC mkdir -p build
25-
26-
# Temporarily disable errexit, because Travis macOS fails without error message
27-
set +o errexit
28-
cd build || (echo "could not enter build directory"; exit 1)
29-
set -o errexit
23+
export P_CI_DIR="$P_CI_DIR/build"
3024

3125
BEGIN_FOLD configure
3226
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"
3832
DOCKER_EXEC make distdir VERSION=$HOST
3933
END_FOLD
4034

41-
set +o errexit
42-
cd "bitcoin-$HOST" || (echo "could not enter distdir bitcoin-$HOST"; exit 1)
43-
set -o errexit
35+
export P_CI_DIR="$P_CI_DIR/bitcoin-$HOST"
4436

4537
BEGIN_FOLD configure
4638
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
5244
BEGIN_FOLD build
5345
DOCKER_EXEC make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && DOCKER_EXEC make $GOAL V=1 ; false )
5446
END_FOLD
55-
56-
set +o errexit
57-
cd ${BASE_ROOT_DIR} || (echo "could not enter base root dir $BASE_ROOT_DIR"; exit 1)
58-
set -o errexit

ci/test/06_script_b.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66

77
export LC_ALL=C.UTF-8
88

9-
# Temporarily disable errexit, because Travis macOS fails without error message
10-
set +o errexit
11-
cd "build/bitcoin-$HOST" || (echo "could not enter distdir build/bitcoin-$HOST"; exit 1)
12-
set -o errexit
13-
149
if [ -n "$QEMU_USER_CMD" ]; then
1510
BEGIN_FOLD wrap-qemu
1611
echo "Prepare to run functional tests for HOST=$HOST"

0 commit comments

Comments
 (0)