ci(ct/run.sh): use host uid and gid in erlang container for ct

This commit is contained in:
Ivan Dyachkov 2022-11-08 15:00:51 +01:00 committed by firest
parent 6ef7123bb9
commit d90b3760b1
2 changed files with 4 additions and 3 deletions

View File

@ -18,8 +18,10 @@ services:
- emqx_bridge
volumes:
- ../..:/emqx
- ./.cache:/.cache
working_dir: /emqx
tty: true
user: "${UID_GID}"
networks:
emqx_bridge:

View File

@ -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