Compare commits

...

2 commits

Author SHA1 Message Date
8bc6313112 Format some files 2025-01-11 22:00:22 +01:00
b11f4bd67a radicale: 1.24.3 -> 1.25.0 2025-01-11 22:00:09 +01:00
3 changed files with 16 additions and 19 deletions

View file

@ -3,9 +3,10 @@
set -euo pipefail
first_server="${SERVERS%% *}"
previous_manifest=$(ssh -T "root@$first_server" << EOF
if [[ -f "$GCROOTDIR/${NAME}.yml" ]]; then
cat "$GCROOTDIR/${NAME}.yml"
previous_manifest=$(
envsubst <<EOF | ssh -T "root@$first_server"
if [[ -f "$GCROOTDIR/$NAME.yml" ]]; then
cat "$GCROOTDIR/$NAME.yml"
fi
EOF
)
@ -14,30 +15,26 @@ set +e
if [ -z "$previous_manifest" ]; then
echo No previous manifest found!
else
$DYFF between <(echo $previous_manifest) $MANIFEST \
$DYFF between <(echo "$previous_manifest") "$MANIFEST" \
--exclude-regexp metadata.labels.kubenix/hash \
--exclude-regexp labels.kubenix/hash \
--set-exit-code
if [ $? -eq 0 ]; then
exit 0
fi
--set-exit-code
fi
set -e
read -r -p "Continue? " response
read -r -p "Continue? " _
echo Uploading closure...
for server in $SERVERS; do
echo Uploading closure to $server...
nix copy --to "ssh://root@$server.dmz" $MANIFEST
echo Uploading closure to "$server"...
nix copy --to "ssh://root@$server.dmz" "$MANIFEST"
ssh "root@$server.dmz" "mkdir -p $GCROOTDIR && ln -sf $MANIFEST $GCROOTDIR/${NAME}.yml"
done
echo Applying Kubernetes manifest...
export KUBECTL_APPLYSET=true
vals eval -fail-on-missing-key-in-map <$MANIFEST | \
kubectl apply -f - \
--prune \
--applyset applyset-$NAME \
--namespace $NAMESPACE
vals eval -fail-on-missing-key-in-map <"$MANIFEST" |
kubectl apply -f - \
--prune \
--applyset applyset-"$NAME" \
--namespace "$NAMESPACE"

View file

@ -20,7 +20,7 @@
immich-postgres = "docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0";
kitchenowl = "tombursch/kitchenowl:v0.6.4";
cyberchef = "mpepping/cyberchef:latest";
freshrss = "freshrss/freshrss:1.24.3";
freshrss = "freshrss/freshrss:1.25.0";
bind9 = "ubuntu/bind9:9.18-22.04_beta";
hedgedoc = "quay.io/hedgedoc/hedgedoc:1.10.0";
minecraft = "itzg/minecraft-server:latest";

View file

@ -64,7 +64,7 @@ flake-utils.lib.eachDefaultSystem
pkgs.symlinkJoin
{
name = "applyset-deploy.sh";
paths = [deployScript pkgs.vals pkgs.kubectl];
paths = [deployScript pkgs.vals pkgs.kubectl pkgs.gettext];
buildInputs = [pkgs.makeWrapper];
passthru.manifest = result;
meta.mainProgram = "applyset-deploy.sh";