diff --git a/src/commands/connect-container.yml b/src/commands/connect-container.yml index ca01dc4..4406f85 100644 --- a/src/commands/connect-container.yml +++ b/src/commands/connect-container.yml @@ -40,7 +40,15 @@ steps: name: "Tailscale Up" command: | HOSTNAME="circleci-$(cat /etc/hostname)" - tailscale --socket=/tmp/tailscaled.sock up --authkey ${<< parameters.auth-key >>} --hostname=${HOSTNAME} --accept-routes --timeout=10s + for run in {1..3}; do + echo "Tailscale connection attempt #${run}" + tailscale --socket=/tmp/tailscaled.sock up --authkey ${<< parameters.auth-key >>} --hostname=${HOSTNAME} --accept-routes --timeout=10s + if [ $? = 0 ]; then + exit 0 + fi + done + echo "Error: could not connect to tailscale" + exit 1 - when: condition: << parameters.export-proxies >> steps: