Diff changes between manifests
This commit is contained in:
parent
53b2723194
commit
948594f5d3
3 changed files with 35 additions and 12 deletions
|
@ -2,6 +2,27 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
first_server="${SERVERS%% *}"
|
||||||
|
previous_manifest=$(ssh -T "root@$first_server" << EOF
|
||||||
|
if [[ -f "$GCROOTDIR/${NAME}.yml" ]]; then
|
||||||
|
cat "$GCROOTDIR/${NAME}.yml"
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
set +e
|
||||||
|
if [ -z "$previous_manifest" ]; then
|
||||||
|
echo No previous manifest found!
|
||||||
|
else
|
||||||
|
$DYFF between --set-exit-code <(echo $previous_manifest) $MANIFEST
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
set -e
|
||||||
|
|
||||||
|
read -r -p "Continue? " response
|
||||||
|
|
||||||
echo Uploading closure...
|
echo Uploading closure...
|
||||||
for server in $SERVERS; do
|
for server in $SERVERS; do
|
||||||
echo Uploading closure to $server...
|
echo Uploading closure to $server...
|
||||||
|
|
25
flake.lock
25
flake.lock
|
@ -13,6 +13,7 @@
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715503080,
|
"lastModified": 1715503080,
|
||||||
"narHash": "sha256-/VnzHTpTq3u0z2Vgu/vKU0SHwOUIu8olHDORWT0IofM=",
|
"narHash": "sha256-/VnzHTpTq3u0z2Vgu/vKU0SHwOUIu8olHDORWT0IofM=",
|
||||||
|
"ref": "refs/heads/master",
|
||||||
"rev": "7296f7f5bf5f089a5137036dcbd8058cf3e4a9e5",
|
"rev": "7296f7f5bf5f089a5137036dcbd8058cf3e4a9e5",
|
||||||
"revCount": 21,
|
"revCount": 21,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -73,11 +74,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719459426,
|
"lastModified": 1726867691,
|
||||||
"narHash": "sha256-4Kn9Pb3lvsik/VYsEAYgXpkcmLhrr0tTE6oIT2PMSPA=",
|
"narHash": "sha256-IK3r16N9pizf53AipOmrcrcyjVsPJwC4PI5hIqEyKwQ=",
|
||||||
"owner": "kirelagin",
|
"owner": "kirelagin",
|
||||||
"repo": "dns.nix",
|
"repo": "dns.nix",
|
||||||
"rev": "e6693931023206f1f3c2bfc57d2c98b5f27f52e6",
|
"rev": "a3196708a56dee76186a9415c187473b94e6cbae",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -282,11 +283,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710146030,
|
"lastModified": 1726560853,
|
||||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -451,11 +452,11 @@
|
||||||
"poetry2nix": "poetry2nix"
|
"poetry2nix": "poetry2nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725758289,
|
"lastModified": 1728695719,
|
||||||
"narHash": "sha256-7Och9QDZx5i7yNJYo/l3z46vYB7c6Hg5/XPyxMGX5mM=",
|
"narHash": "sha256-0BJrse7b2jwKQ0oqBKWK7qmH+Km1ENAGzrsIG+yYGbY=",
|
||||||
"owner": "farcaller",
|
"owner": "farcaller",
|
||||||
"repo": "nixhelm",
|
"repo": "nixhelm",
|
||||||
"rev": "f5e54a73ff511396e0262f82d34933c8745bda05",
|
"rev": "8784378fb80a27fd874e91c3c60106958036ec45",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -573,11 +574,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1725634671,
|
"lastModified": 1728492678,
|
||||||
"narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=",
|
"narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c",
|
"rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -71,6 +71,7 @@ inputs@{ self, servers, flutils, nixpkgs, kubenix, ... }: flutils.lib.eachDefaul
|
||||||
--set NAME '${name}' \
|
--set NAME '${name}' \
|
||||||
--set NAMESPACE '${namespace}' \
|
--set NAMESPACE '${namespace}' \
|
||||||
--set SERVERS '${k8sServerNames}' \
|
--set SERVERS '${k8sServerNames}' \
|
||||||
|
--set DYFF '${lib.getExe pkgs.dyff}' \
|
||||||
--set GCROOTDIR '/nix/var/nix/gcroots/kubernetes-manifests'
|
--set GCROOTDIR '/nix/var/nix/gcroots/kubernetes-manifests'
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue