ci(ct/run.sh): use host uid and gid in erlang container for ct
This commit is contained in:
parent
6ef7123bb9
commit
d90b3760b1
|
@ -18,8 +18,10 @@ services:
|
||||||
- emqx_bridge
|
- emqx_bridge
|
||||||
volumes:
|
volumes:
|
||||||
- ../..:/emqx
|
- ../..:/emqx
|
||||||
|
- ./.cache:/.cache
|
||||||
working_dir: /emqx
|
working_dir: /emqx
|
||||||
tty: true
|
tty: true
|
||||||
|
user: "${UID_GID}"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
emqx_bridge:
|
emqx_bridge:
|
||||||
|
|
|
@ -90,7 +90,7 @@ for file in "${FILES[@]}"; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# shellcheck disable=2086 # no quotes for F_OPTIONS
|
# 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
|
# /emqx is where the source dir is mounted to the Erlang container
|
||||||
# in .ci/docker-compose-file/docker-compose.yaml
|
# in .ci/docker-compose-file/docker-compose.yaml
|
||||||
|
@ -98,7 +98,6 @@ TTY=''
|
||||||
if [[ -t 1 ]]; then
|
if [[ -t 1 ]]; then
|
||||||
TTY='-t'
|
TTY='-t'
|
||||||
fi
|
fi
|
||||||
docker exec -i $TTY "$ERLANG_CONTAINER" bash -c 'git config --global --add safe.directory /emqx'
|
|
||||||
|
|
||||||
if [ "$CONSOLE" = 'yes' ]; then
|
if [ "$CONSOLE" = 'yes' ]; then
|
||||||
docker exec -i $TTY "$ERLANG_CONTAINER" bash -c "make run"
|
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"
|
docker exec -i $TTY "$ERLANG_CONTAINER" bash -c "make ${WHICH_APP}-ct"
|
||||||
RESULT=$?
|
RESULT=$?
|
||||||
# shellcheck disable=2086 # no quotes for F_OPTIONS
|
# 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
|
exit $RESULT
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue