diff --git a/src/commands/connect.yml b/src/commands/connect.yml index aba4401..6492b32 100644 --- a/src/commands/connect.yml +++ b/src/commands/connect.yml @@ -10,6 +10,10 @@ parameters: at the following URL: https://tailscale.com/kb/1111/ephemeral-nodes/ type: env_var_name default: "TS_AUTHKEY" + export-proxies: + description: "Whether or not to export the proxy environment variables." + type: boolean + default: true proxy-address: type: string default: "localhost" @@ -34,8 +38,14 @@ steps: command: | HOSTNAME="circleci-$(cat /etc/hostname)" tailscale --socket=/tmp/tailscaled.sock up --authkey ${<< parameters.auth-key >>} --hostname=${HOSTNAME} --accept-routes --timeout=10s - echo "export ALL_PROXY=socks5://<< parameters.proxy-address >>:1055/" >> $BASH_ENV - echo "export HTTP_PROXY=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV - echo "export HTTPS_PROXY=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV - echo "export http_proxy=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV - echo "export https_proxy=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV + - when: + condition: << parameters.export-proxies >> + steps: + - run: + name: "Export Tailscale Proxy Envars" + command: | + echo "export ALL_PROXY=socks5://<< parameters.proxy-address >>:1055/" >> $BASH_ENV + echo "export HTTP_PROXY=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV + echo "export HTTPS_PROXY=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV + echo "export http_proxy=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV + echo "export https_proxy=http://<< parameters.proxy-address >>:1055/" >> $BASH_ENV