chore: consolidate bash commands in ct/run.sh
This commit is contained in:
parent
98fcd2c1dd
commit
ad1def08c8
|
@ -276,14 +276,18 @@ if [ "$STOP" = 'no' ]; then
|
||||||
set -e
|
set -e
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# rebar, mix and hex cache directory need to be writable by $DOCKER_USER
|
if [ "$DOCKER_USER" != "root" ]; then
|
||||||
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "mkdir -p /.cache /.hex /.mix && chown $DOCKER_USER /.cache /.hex /.mix"
|
# the user must exist inside the container for `whoami` to work
|
||||||
# need to initialize .erlang.cookie manually here because / is not writable by $DOCKER_USER
|
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c \
|
||||||
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "openssl rand -base64 -hex 16 > /.erlang.cookie && chown $DOCKER_USER /.erlang.cookie && chmod 0400 /.erlang.cookie"
|
"useradd --uid $DOCKER_USER -M -d / emqx && \
|
||||||
# the user must exist inside the container for `whoami` to work
|
mkdir -p /.cache /.hex /.mix && \
|
||||||
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "useradd --uid $DOCKER_USER -M -d / emqx" || true
|
chown $DOCKER_USER /.cache /.hex /.mix && \
|
||||||
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "chown -R $DOCKER_USER /var/lib/secret" || true
|
openssl rand -base64 -hex 16 > /.erlang.cookie && \
|
||||||
docker exec -i $TTY -u root:root "$ERLANG_CONTAINER" bash -c "$INSTALL_ODBC" || true
|
chown $DOCKER_USER /.erlang.cookie && \
|
||||||
|
chmod 0400 /.erlang.cookie && \
|
||||||
|
chown -R $DOCKER_USER /var/lib/secret && \
|
||||||
|
$INSTALL_ODBC" || true
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$ONLY_UP" = 'yes' ]; then
|
if [ "$ONLY_UP" = 'yes' ]; then
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue