From 9907911e48208f8d754db9c21ab921b1a87bbd66 Mon Sep 17 00:00:00 2001 From: Illia Chub Date: Wed, 12 Jan 2022 07:22:10 +0200 Subject: [PATCH] Added server teardown phase --- .drone.yml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0cf1ad6..a4ffd1c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -93,26 +93,4 @@ steps: - export machineid=$( for i in {0..24}; do jq 'if .servers['$i'].name == "ci-sibling" then .servers['$i'].id else null end' .hetzner_servers.json; done | grep -v null | sed 's/"//g') - > curl -s -X DELETE "https://api.hetzner.cloud/v1/servers/$machineid" - -H "Authorization: Bearer $PASSWORD" - - > - curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" - -H "Authorization: Bearer $CLOUDFLARE_TOKEN" - -H "Content-Type: application/json" > .dns_records.json - - > - for i in {0..24} - do - jq '.result['$i'].id' .dns_records.json - done | grep -v null | sed 's/"//g' > .records - - export recordIDs=() - - > - while IFS=read -r line - do - recordIDs+=("$line") - done < .records - - > - for recordid in "${recordIDs[@]}" - do - curl -s -X DELETE "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$recordid" - -H "Authorization: Bearer $CLOUDFLARE_TOKEN" - -H "Content-Type: application/json" - done \ No newline at end of file + -H "Authorization: Bearer $PASSWORD" \ No newline at end of file