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:
parent
b2c0b74744
commit
605302091d
4 changed files with 17 additions and 2 deletions
14
users/tazjin/dns/default.nix
Normal file
14
users/tazjin/dns/default.nix
Normal 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;
|
||||||
|
}
|
|
@ -1,10 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -ue
|
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 ZONE="${1}"
|
||||||
|
readonly FILE="${2}"
|
||||||
|
|
||||||
gcloud dns record-sets import "${ZONE}" \
|
gcloud dns record-sets import "${FILE}" \
|
||||||
--project composite-watch-759 \
|
--project composite-watch-759 \
|
||||||
--zone-file-format \
|
--zone-file-format \
|
||||||
--delete-all-existing \
|
--delete-all-existing \
|
Loading…
Reference in a new issue