From d90b3760b1563a825b42ff539d10da5fbf5c226b Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Tue, 8 Nov 2022 15:00:51 +0100 Subject: [PATCH] ci(ct/run.sh): use host uid and gid in erlang container for ct --- .ci/docker-compose-file/docker-compose.yaml | 2 ++ scripts/ct/run.sh | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.ci/docker-compose-file/docker-compose.yaml b/.ci/docker-compose-file/docker-compose.yaml index 2612eb8d8..8e723f117 100644 --- a/.ci/docker-compose-file/docker-compose.yaml +++ b/.ci/docker-compose-file/docker-compose.yaml @@ -18,8 +18,10 @@ services: - emqx_bridge volumes: - ../..:/emqx + - ./.cache:/.cache working_dir: /emqx tty: true + user: "${UID_GID}" networks: emqx_bridge: diff --git a/scripts/ct/run.sh b/scripts/ct/run.sh index 879efc434..00e2278cf 100755 --- a/scripts/ct/run.sh +++ b/scripts/ct/run.sh @@ -90,7 +90,7 @@ for file in "${FILES[@]}"; do done # shellcheck disable=2086 # no quotes for F_OPTIONS -docker-compose $F_OPTIONS up -d --build +UID_GID="$(id -u):$(id -g)" docker-compose $F_OPTIONS up -d --build # /emqx is where the source dir is mounted to the Erlang container # in .ci/docker-compose-file/docker-compose.yaml @@ -98,7 +98,6 @@ TTY='' if [[ -t 1 ]]; then TTY='-t' fi -docker exec -i $TTY "$ERLANG_CONTAINER" bash -c 'git config --global --add safe.directory /emqx' if [ "$CONSOLE" = 'yes' ]; then docker exec -i $TTY "$ERLANG_CONTAINER" bash -c "make run" @@ -107,6 +106,6 @@ else docker exec -i $TTY "$ERLANG_CONTAINER" bash -c "make ${WHICH_APP}-ct" RESULT=$? # shellcheck disable=2086 # no quotes for F_OPTIONS - docker-compose $F_OPTIONS down + UID_GID="$(id -u):$(id -g)" docker-compose $F_OPTIONS down exit $RESULT fi