about summary refs log tree commit diff
path: root/users/tazjin/dns/import
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-04-14T15·20+0200
committertazjin <mail@tazj.in>2021-04-14T15·23+0000
commit605302091d6f35f6c6cd56170fde1c932cdb28ee (patch)
tree90cef542b09b8fd5cabcec71936198ae2a342e18 /users/tazjin/dns/import
parentb2c0b747442db4dd6d28091a4cd5ceb0ca2a159f (diff)
refactor(tazjin/dns): Add zone validity checks in CI r/2510
Same as //ops/dns

Change-Id: I0399efd2e48956ec91833386adff27d94d08ef1e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3013
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'users/tazjin/dns/import')
-rwxr-xr-xusers/tazjin/dns/import12
1 files changed, 12 insertions, 0 deletions
diff --git a/users/tazjin/dns/import b/users/tazjin/dns/import
new file mode 100755
index 000000000000..8ea1d694c9a1
--- /dev/null
+++ b/users/tazjin/dns/import
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -ue
+
+# Imports a zone file into Google Cloud DNS
+readonly ZONE="${1}"
+readonly FILE="${2}"
+
+gcloud dns record-sets import "${FILE}" \
+       --project composite-watch-759 \
+       --zone-file-format \
+       --delete-all-existing \
+       --zone "${ZONE}"