ci(gl): deploy via tailscale

workaround provided by https://github.com/tailscale/tailscale/issues/11628#issuecomment-2039012828
This commit is contained in:
Ming Di Leom 2025-03-28 10:22:53 +00:00
parent 0f02802ebd
commit 443c7ecd18
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 10 additions and 5 deletions

View File

@ -49,16 +49,21 @@ deploy:
stage: deploy
before_script:
- apk update && apk add openssh-client rsync
- apk update && apk add openrc tailscale openssh-client rsync
- mkdir -p /run/openrc/
- touch /run/openrc/softlevel
- rc-service -Z tailscale start
- rc-service tailscale start
- tailscale up --auth-key="${TAILSCALE_OAUTH}?ephemeral=true&preauthorized=true" --advertise-tags=tag:gl-ci --hostname="gitlab-$(cat /etc/hostname)" --accept-routes
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" | base64 --decode > ~/.ssh/known_hosts
- echo "$SSH_KNOWN_HOSTS" | base64 -d > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- echo "$SSH_KEY_1" | base64 --decode > ~/.ssh/id_host_1
- echo "$SSH_KEY_1" | base64 -d > ~/.ssh/id_host_1
- chmod 600 ~/.ssh/id_host_1
- echo "$SSH_KEY_2" | base64 --decode > ~/.ssh/id_host_2
- echo "$SSH_KEY_2" | base64 -d > ~/.ssh/id_host_2
- chmod 600 ~/.ssh/id_host_2
- echo "$SSH_CONFIG" | base64 --decode > ~/.ssh/config
- echo "$SSH_CONFIG" | base64 -d > ~/.ssh/config
- chmod 600 ~/.ssh/config
script: