From fbd87e01c5858d07594c1ec5d7253afde369d169 Mon Sep 17 00:00:00 2001 From: Mirko Milovanovic Date: Sun, 30 Mar 2025 16:10:22 +0200 Subject: [PATCH] feat: enhance .env.example with cluster hostname support and update start-nodes.sh to replace environment variables --- .env.example | 1 + selenium-standalone-stack/start-nodes.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 919071c..437df3b 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ # User defined hostname persisted across all sessions, used to keep track of the same user +# Set to $NODE_NAME to use the hostname of the node when running a cluster with Hetzner Cloud CLI TELEGRAF_HOSTNAME= # MongoDB connection string TELEGRAF_MONGODB_DSN=mongodb://stats_user:%40z%5EVFhN7q%25vzit@tube.kobim.cloud:27107/?authSource=statistics diff --git a/selenium-standalone-stack/start-nodes.sh b/selenium-standalone-stack/start-nodes.sh index 65fb6ad..1fb0fe9 100644 --- a/selenium-standalone-stack/start-nodes.sh +++ b/selenium-standalone-stack/start-nodes.sh @@ -77,8 +77,13 @@ echo "Starting $NUMBER Selenium nodes" for NB in $(seq 1 "$NUMBER"); do NODE_NAME="selenium-${HOST}-instance-${NB}" - + # Replace variables in the environment file + TEMP_ENV_FILE=$(mktemp) + while IFS= read -r line; do + eval "echo \"$line\"" + done < "$ENV_FILE" > "$TEMP_ENV_FILE" + ENV_FILE="$TEMP_ENV_FILE" echo "Starting Selenium node n°$NB" docker run --rm \