chore: fix /.cache and /.erlang.cookie in erlang container

This commit is contained in:
Ivan Dyachkov 2022-11-09 09:30:32 +01:00
parent 9b999f070d
commit 7bbd6353aa
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -90,8 +90,8 @@ for file in "${FILES[@]}"; do
done
# shellcheck disable=2086 # no quotes for F_OPTIONS
mkdir -p ./.cache && chmod a+rwx ./.cache
UID_GID="$(id -u):$(id -g)" docker-compose $F_OPTIONS up -d --build
UID_GID="$(id -u):$(id -g)"
UID_GID=$UID_GID 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
@ -100,6 +100,8 @@ if [[ -t 1 ]]; then
TTY='-t'
fi
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "mkdir /.cache && chown $UID_GID /.cache"
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "touch /.erlang.cookie && chown $UID_GID /.erlang.cookie"
if [ "$CONSOLE" = 'yes' ]; then
docker exec -i $TTY "$ERLANG_CONTAINER" bash -c "make run"
else
@ -107,6 +109,6 @@ else
docker exec -i $TTY "$ERLANG_CONTAINER" bash -c "make ${WHICH_APP}-ct"
RESULT=$?
# shellcheck disable=2086 # no quotes for F_OPTIONS
UID_GID="$(id -u):$(id -g)" docker-compose $F_OPTIONS down
UID_GID=$UID_GID docker-compose $F_OPTIONS down
exit $RESULT
fi