From 4bd2ff69190b9595753d886a752d60d5680117b6 Mon Sep 17 00:00:00 2001 From: Illia Chub Date: Tue, 11 Jan 2022 07:46:57 +0200 Subject: [PATCH] PoC: Alternative envvar definition --- .drone.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.drone.yml b/.drone.yml index 18a1499..df23b38 100644 --- a/.drone.yml +++ b/.drone.yml @@ -38,6 +38,12 @@ steps: ZONE_ID: from_secret: ZONE_ID 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" -H "Authorization: Bearer $CLOUDFLARE_TOKEN"