aboutsummaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-07-24 14:55:18 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-07-24 16:14:24 +0200
commitfabc04a4d96c4fe70e60d365aa28031d149094f3 (patch)
tree4154aa33d30251f3734b3716b33329537dcfe8e9 /ci
parentfa8dcdcc8b29e58f5d285a49dde33d94b63c893b (diff)
downloadbitcoin-fabc04a4d96c4fe70e60d365aa28031d149094f3.tar.xz
ci: Keep system env vars as-is
Diffstat (limited to 'ci')
-rwxr-xr-xci/test/04_install.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh
index b10d560010..ff43698994 100755
--- a/ci/test/04_install.sh
+++ b/ci/test/04_install.sh
@@ -25,7 +25,9 @@ fi
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
# Export all env vars to avoid missing some.
# Though, exclude those with newlines to avoid parsing problems.
- python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value and "HOME" not in key]' | tee /tmp/env
+ python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value and "HOME" != key and "PATH" != key and "USER" != key]' | tee /tmp/env
+ # System-dependent env vars must be kept as is. So read them from the container.
+ docker run --rm "${CI_IMAGE_NAME_TAG}" bash -c "env | grep --extended-regexp '^(HOME|PATH|USER)='" | tee --append /tmp/env
echo "Creating $CI_IMAGE_NAME_TAG container to run in"
DOCKER_BUILDKIT=1 docker build \
--file "${BASE_ROOT_DIR}/ci/test_imagefile" \