Sfoglia il codice sorgente

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

Ivan Dyachkov 3 anni fa
parent
commit
7bbd6353aa
2 ha cambiato i file con 5 aggiunte e 4 eliminazioni
  1. 0 1
      .ci/docker-compose-file/docker-compose.yaml
  2. 5 3
      scripts/ct/run.sh

+ 0 - 1
.ci/docker-compose-file/docker-compose.yaml

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

+ 5 - 3
scripts/ct/run.sh

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