From 90dde1d9c93420d9fe8cbc49d6b1bf238d5801fc Mon Sep 17 00:00:00 2001 From: Tortue Torche <126358-tortuetorche@users.noreply.gitlab.com> Date: Fri, 19 Feb 2021 12:25:44 +0100 Subject: [PATCH] Rename CLUSTER_ variables by SWARM_NODE_ when running tests CLUSTER_NAME -> SWARM_NODE_NAME CLUSTER_IP -> SWARM_NODE_IP --- tests/dockerfiles/.env.local | 4 ++-- tests/run.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/dockerfiles/.env.local b/tests/dockerfiles/.env.local index 790849d..5c8d12e 100644 --- a/tests/dockerfiles/.env.local +++ b/tests/dockerfiles/.env.local @@ -23,5 +23,5 @@ PORTAINER_VERSION=latest PORTAINER_COMMAND_OPTIONS="" #PORTAINER_COMMAND_OPTIONS=" --no-analytics" -CLUSTER_NAME=localhost -CLUSTER_IP=$(hostname -I | awk '{ print $1 }') +SWARM_NODE_NAME=localhost +SWARM_NODE_IP=$(hostname -I | awk '{ print $1 }') diff --git a/tests/run.sh b/tests/run.sh index 07529b0..43fe4fd 100644 --- a/tests/run.sh +++ b/tests/run.sh @@ -13,9 +13,9 @@ fi [[ "$TRACE" ]] && set -x -CLUSTER_NAME=${CLUSTER_NAME:-cluster} -CLUSTER_IP=${CLUSTER_IP:-$(getent hosts $CLUSTER_NAME | awk '{ print $1 }')} -export BASE_DOMAIN="$CLUSTER_IP.nip.io" +SWARM_NODE_NAME=${SWARM_NODE_NAME:-cluster} +SWARM_NODE_IP=${SWARM_NODE_IP:-$(getent hosts $SWARM_NODE_NAME | awk '{ print $1 }')} +export BASE_DOMAIN="$SWARM_NODE_IP.nip.io" export PSU_STACK_NAME="web-app" PSU_URL="https://portainer.$BASE_DOMAIN" PSU_USER="admin" @@ -86,7 +86,7 @@ docker swarm init # Parse the Docker traefik stack file to deploy envsubst '$TRAEFIK_VERSION,$BASE_DOMAIN' < dockerfiles/docker-stack-traefik.yml > dockerfiles/docker-stack-traefik-final.yml docker stack deploy -c dockerfiles/docker-stack-traefik-final.yml traefik --with-registry-auth -bash -c "timeout 20 bash -c 'while ! (echo > /dev/tcp/$CLUSTER_NAME/443 && curl -fks --max-time 2 https://traefik.$BASE_DOMAIN) >/dev/null 2>&1; do sleep 1; done;'" +bash -c "timeout 20 bash -c 'while ! (echo > /dev/tcp/$SWARM_NODE_NAME/443 && curl -fks --max-time 2 https://traefik.$BASE_DOMAIN) >/dev/null 2>&1; do sleep 1; done;'" # Deploy Portainer test # Create admin password as a Docker secret