refactor(tazjin/dns): Add zone validity checks in CI

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>
This commit is contained in:
Vincent Ambo 2021-04-14 17:20:16 +02:00 committed by tazjin
parent b2c0b74744
commit 605302091d
4 changed files with 17 additions and 2 deletions

View file

@ -0,0 +1,14 @@
# Performs simple (local-only) validity checks on DNS zones.
{ depot, pkgs, ... }:
let
inherit (depot.nix.utils) drvTargets;
checkZone = zone: file: pkgs.runCommandNoCC "${zone}-check" {} ''
${pkgs.bind}/bin/named-checkzone -i local ${zone} ${file} | tee $out
'';
in drvTargets {
kontemplate-works = checkZone "kontemplate.works"./kontemplate.works.zone;
tazj-in = checkZone "tazj.in" ./tazj.in.zone;
}

View file

@ -1,10 +1,11 @@
#!/bin/sh
set -ue
# Imports a zone file into a Google Cloud DNS zone of the same name
# Imports a zone file into Google Cloud DNS
readonly ZONE="${1}"
readonly FILE="${2}"
gcloud dns record-sets import "${ZONE}" \
gcloud dns record-sets import "${FILE}" \
--project composite-watch-759 \
--zone-file-format \
--delete-all-existing \