diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-03-31 10:20:15 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-04-06 11:52:30 +0200 |
commit | fa5af94de6aa4643b30ab526b6249340bff34d43 (patch) | |
tree | f93ce151584d6d813d273360906484aebb8de192 /ci/test/04_install.sh | |
parent | 5a8bd4505687a7ec76d731b1a8249ee04d641990 (diff) |
ci: Run base install at most once
This should avoid errors when running it twice. For example, network
errors on the second invocation of 'apt update'; or unguarded
modifications such as APPEND_APT_SOURCES_LIST, which will append the
same string repeatedly.
The base install may be run twice in Cirrus CI with dockerfiles, or
locally when running twice with DANGER_RUN_CI_ON_HOST specified.
Diffstat (limited to 'ci/test/04_install.sh')
-rwxr-xr-x | ci/test/04_install.sh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 22045c4d1f..1024222e96 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -55,14 +55,8 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then $CONTAINER_NAME) export CI_CONTAINER_ID export CI_EXEC_CMD_PREFIX="docker exec ${CI_CONTAINER_ID}" - $CI_EXEC_CMD_PREFIX rsync --archive --stats --human-readable /ci_base_install/ "${BASE_ROOT_DIR}" - $CI_EXEC_CMD_PREFIX rsync --archive --stats --human-readable /ro_base/ "$BASE_ROOT_DIR" - # Fixes permission issues when there is a container UID/GID mismatch with the owner - # of the mounted bitcoin src dir. - $CI_EXEC_CMD_PREFIX git config --global --add safe.directory "*" else echo "Running on host system without docker wrapper" - "${BASE_ROOT_DIR}/ci/test/01_base_install.sh" fi CI_EXEC () { @@ -70,6 +64,13 @@ CI_EXEC () { } export -f CI_EXEC +CI_EXEC rsync --archive --stats --human-readable /ci_base_install/ "${BASE_ROOT_DIR}" || echo "/ci_base_install/ missing" +CI_EXEC "${BASE_ROOT_DIR}/ci/test/01_base_install.sh" +CI_EXEC rsync --archive --stats --human-readable /ro_base/ "${BASE_ROOT_DIR}" || echo "Nothing to copy from ro_base" +# Fixes permission issues when there is a container UID/GID mismatch with the owner +# of the git source code directory. +CI_EXEC git config --global --add safe.directory \"*\" + CI_EXEC mkdir -p "${BINS_SCRATCH_DIR}" if [ "$CI_OS_NAME" == "macos" ]; then |