Skip to content

Commit fabc04a

Browse files
author
MarcoFalke
committed
ci: Keep system env vars as-is
1 parent fa8dcdc commit fabc04a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ci/test/04_install.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ fi
2525
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
2626
# Export all env vars to avoid missing some.
2727
# Though, exclude those with newlines to avoid parsing problems.
28-
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
28+
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
29+
# System-dependent env vars must be kept as is. So read them from the container.
30+
docker run --rm "${CI_IMAGE_NAME_TAG}" bash -c "env | grep --extended-regexp '^(HOME|PATH|USER)='" | tee --append /tmp/env
2931
echo "Creating $CI_IMAGE_NAME_TAG container to run in"
3032
DOCKER_BUILDKIT=1 docker build \
3133
--file "${BASE_ROOT_DIR}/ci/test_imagefile" \

0 commit comments

Comments
 (0)