Skip to content

Commit fa2ffe8

Browse files
author
MarcoFalke
committed
ci: Deduplicate DOCKER_EXEC
1 parent fac2eee commit fa2ffe8

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

ci/test/04_install.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,14 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
4848
--env-file /tmp/env \
4949
--name $CONTAINER_NAME \
5050
$DOCKER_NAME_TAG)
51-
52-
DOCKER_EXEC () {
53-
docker exec $DOCKER_ID bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*"
54-
}
51+
export DOCKER_CI_CMD_PREFIX="docker exec $DOCKER_ID"
5552
else
5653
echo "Running on host system without docker wrapper"
57-
DOCKER_EXEC () {
58-
bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*"
59-
}
6054
fi
55+
56+
DOCKER_EXEC () {
57+
$DOCKER_CI_CMD_PREFIX bash -c "export PATH=$BASE_SCRATCH_DIR/bins/:\$PATH && cd $P_CI_DIR && $*"
58+
}
6159
export -f DOCKER_EXEC
6260

6361
if [ -n "$DPKG_ADD_ARCH" ]; then

0 commit comments

Comments
 (0)