PoC: Alternative envvar definition

This commit is contained in:
Illia Chub 2022-01-11 07:46:57 +02:00
parent b4a9bea8b3
commit 4bd2ff6919

View file

@ -38,6 +38,12 @@ steps:
ZONE_ID: ZONE_ID:
from_secret: ZONE_ID from_secret: ZONE_ID
commands: commands:
- >
curl -s
-H "Authorization: Bearer $PASSWORD"
'https://api.hetzner.cloud/v1/servers' > .machine.json
- >
export machineip=$( for i in {0..24}; do jq 'if .servers['$i'].name == "selfprivacy-mailserver" then .servers['$i'].public_net.ipv4.ip else null end' .machine.json; done | grep -v null | sed 's/"//' | sed 's/"//' )
- > - >
curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$DOMAIN" curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$DOMAIN"
-H "Authorization: Bearer $CLOUDFLARE_TOKEN" -H "Authorization: Bearer $CLOUDFLARE_TOKEN"