mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect.git
synced 2024-11-29 06:31:28 +00:00
Added server teardown phase
This commit is contained in:
parent
2329706eb7
commit
9907911e48
22
.drone.yml
22
.drone.yml
|
@ -94,25 +94,3 @@ steps:
|
|||
- >
|
||||
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
|
Loading…
Reference in a new issue