Skip to content

Commit 2c5c763

Browse files
pks-tgitster
authored andcommitted
ci: fix setup of custom path for GitLab CI
Part of "install-dependencies.sh" is to install some binaries required for tests into a custom directory that gets added to the PATH. This directory is located at "$HOME/path" and thus depends on the current user that the script executes as. This creates problems for GitLab CI, which installs dependencies as the root user, but runs tests as a separate, unprivileged user. As their respective home directories are different, we will end up using two different custom path directories. Consequently, the unprivileged user will not be able to find the binaries that were set up as root user. Fix this issue by allowing CI to override the custom path, which allows GitLab to set up a constant value that isn't derived from "$HOME". Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d1ef3d3 commit 2c5c763

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ workflow:
99

1010
test:linux:
1111
image: $image
12+
variables:
13+
CUSTOM_PATH: "/custom"
1214
before_script:
1315
- ./ci/install-docker-dependencies.sh
1416
script:

ci/lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ macos-*)
350350
;;
351351
esac
352352

353-
CUSTOM_PATH="$HOME/path"
353+
CUSTOM_PATH="${CUSTOM_PATH:-$HOME/path}"
354354
export PATH="$CUSTOM_PATH:$PATH"
355355

356356
case "$jobname" in

0 commit comments

Comments
 (0)