chore(CI): update redis image

This commit is contained in:
zhanghongtong 2021-03-30 06:00:45 +00:00 committed by Rory Z
parent ac9a229c37
commit 65e044abc0
8 changed files with 15 additions and 13 deletions

View File

@ -6,7 +6,7 @@ services:
container_name: redis container_name: redis
volumes: volumes:
- ./redis/:/data/conf - ./redis/:/data/conf
command: bash -c "/bin/bash /data/conf/redis.sh --node cluster && while true; do echo 1; sleep 1; done" command: bash -c "/bin/bash /data/conf/redis.sh --node cluster && tail -f /var/log/redis-server.log"
networks: networks:
emqx_bridge: emqx_bridge:
# Assign a public address. Erlang container cannot find cluster nodes by network-scoped alias (redis_cluster). # Assign a public address. Erlang container cannot find cluster nodes by network-scoped alias (redis_cluster).

View File

@ -7,7 +7,7 @@ services:
volumes: volumes:
- ../../apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs:/tls - ../../apps/emqx_auth_redis/test/emqx_auth_redis_SUITE_data/certs:/tls
- ./redis/:/data/conf - ./redis/:/data/conf
command: bash -c "/bin/bash /data/conf/redis.sh --node cluster --tls-enabled && while true; do echo 1; sleep 1; done" command: bash -c "/bin/bash /data/conf/redis.sh --node cluster --tls-enabled && tail -f /var/log/redis-server.log"
networks: networks:
emqx_bridge: emqx_bridge:
# Assign a public address. Erlang container cannot find cluster nodes by network-scoped alias (redis_cluster). # Assign a public address. Erlang container cannot find cluster nodes by network-scoped alias (redis_cluster).

View File

@ -6,7 +6,7 @@ services:
image: redis:${REDIS_TAG} image: redis:${REDIS_TAG}
volumes: volumes:
- ./redis/:/data/conf - ./redis/:/data/conf
command: bash -c "/bin/bash /data/conf/redis.sh --node sentinel && while true; do echo 1; sleep 1; done" command: bash -c "/bin/bash /data/conf/redis.sh --node sentinel && tail -f /var/log/redis-server.log"
networks: networks:
emqx_bridge: emqx_bridge:
# Assign a public address. Erlang container cannot find cluster nodes by network-scoped alias (redis_cluster). # Assign a public address. Erlang container cannot find cluster nodes by network-scoped alias (redis_cluster).

View File

@ -1,5 +1,6 @@
daemonize yes daemonize yes
bind 0.0.0.0 :: bind 0.0.0.0 ::
logfile /var/log/redis-server.log
tls-cert-file /tls/redis.crt tls-cert-file /tls/redis.crt
tls-key-file /tls/redis.key tls-key-file /tls/redis.key
tls-ca-cert-file /tls/ca.crt tls-ca-cert-file /tls/ca.crt

View File

@ -1,2 +1,3 @@
daemonize yes daemonize yes
bind 0.0.0.0 :: bind 0.0.0.0 ::
logfile /var/log/redis-server.log

View File

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
set -x
LOCAL_IP=$(hostname -i | grep -oE '((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])\.){3}(25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])' | head -n 1)
node=single node=single
tls=false tls=false
while [[ $# -gt 0 ]] while [[ $# -gt 0 ]]
@ -48,9 +52,9 @@ elif [ "${node}" = "sentinel" ] ; then
redis-server /data/conf/redis.conf --port 7000 --cluster-config-file /data/conf/nodes.7000.conf \ redis-server /data/conf/redis.conf --port 7000 --cluster-config-file /data/conf/nodes.7000.conf \
--cluster-enabled no; --cluster-enabled no;
redis-server /data/conf/redis.conf --port 7001 --cluster-config-file /data/conf/nodes.7001.conf \ redis-server /data/conf/redis.conf --port 7001 --cluster-config-file /data/conf/nodes.7001.conf \
--cluster-enabled no --slaveof 172.16.239.10 7000; --cluster-enabled no --slaveof "$LOCAL_IP" 7000;
redis-server /data/conf/redis.conf --port 7002 --cluster-config-file /data/conf/nodes.7002.conf \ redis-server /data/conf/redis.conf --port 7002 --cluster-config-file /data/conf/nodes.7002.conf \
--cluster-enabled no --slaveof 172.16.239.10 7000; --cluster-enabled no --slaveof "$LOCAL_IP" 7000;
fi fi
REDIS_LOAD_FLG=true; REDIS_LOAD_FLG=true;
@ -76,7 +80,7 @@ do
continue; continue;
fi fi
if [ "${node}" = "cluster" ] ; then if [ "${node}" = "cluster" ] ; then
yes "yes" | redis-cli --cluster create 172.16.239.10:7000 172.16.239.10:7001 172.16.239.10:7002; yes "yes" | redis-cli --cluster create "$LOCAL_IP:7000" "$LOCAL_IP:7001" "$LOCAL_IP:7002";
elif [ "${node}" = "sentinel" ] ; then elif [ "${node}" = "sentinel" ] ; then
cp /data/conf/sentinel.conf /_sentinel.conf cp /data/conf/sentinel.conf /_sentinel.conf
redis-server /_sentinel.conf --sentinel; redis-server /_sentinel.conf --sentinel;

View File

@ -1,3 +1,4 @@
port 26379 port 26379
dir /tmp dir /tmp
sentinel monitor mymaster 172.16.239.10 7000 1 sentinel monitor mymaster 172.16.239.10 7000 1
logfile /var/log/redis-server.log

View File

@ -364,12 +364,7 @@ jobs:
docker exec -i erlang bash -c "echo \"https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com\" > /root/.git-credentials && git config --global credential.helper store" docker exec -i erlang bash -c "echo \"https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com\" > /root/.git-credentials && git config --global credential.helper store"
fi fi
- name: run test cases - name: run test cases
timeout-minutes: 10
run: | run: |
while ! nc -zv ${EMQX_AUTH__REDIS__SERVER%:*} ${EMQX_AUTH__REDIS__SERVER##*:} > /dev/null 2>&1; do
echo "waiting redis server"
sleep 1
done
export CUTTLEFISH_ENV_OVERRIDE_PREFIX=EMQX_ export CUTTLEFISH_ENV_OVERRIDE_PREFIX=EMQX_
printenv > .env printenv > .env
docker exec -i erlang sh -c "make ensure-rebar3" docker exec -i erlang sh -c "make ensure-rebar3"