Add misc CICD scripts and compose file
This commit is contained in:
22
cicd/add-dns.sh
Executable file
22
cicd/add-dns.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
ZONE_ID=$1
|
||||
RECORD_NAME=$2
|
||||
RECORD_COMMENT=$3
|
||||
API_TOKEN=$4
|
||||
TUNNEL_ID=$5
|
||||
|
||||
curl --request POST --silent \
|
||||
--url https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header "Authorization: Bearer $API_TOKEN" \
|
||||
--data '{
|
||||
"content": "'$TUNNEL_ID'.cfargotunnel.com",
|
||||
"name": "'$RECORD_NAME'",
|
||||
"comment": "'$RECORD_COMMENT'",
|
||||
"proxied": true,
|
||||
"type": "CNAME",
|
||||
"ttl": 1
|
||||
}' \
|
Reference in New Issue
Block a user