Compare commits

..

No commits in common. "58ba834eb0b3c40ec127585c4ad4e6b5f8d5c151" and "b2ffb5d1bbcefcd3de31f1a400d1da7c73c5d3d6" have entirely different histories.

4 changed files with 6 additions and 35 deletions

1
.gitignore vendored
View file

@ -1,4 +1,3 @@
.direnv .direnv
.pre-commit-config.yaml .pre-commit-config.yaml
result result
.manifests

View file

@ -2,31 +2,12 @@
set -euo pipefail set -euo pipefail
CREATE_LOCAL_GCROOT=false
while [[ "$#" -gt 0 ]]; do
case "$1" in
--help)
echo "Use --create-local-gcroot to create local GC root"
exit 0
;;
--create-local-gcroot)
CREATE_LOCAL_GCROOT=true
shift
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
first_server="${SERVERS%% *}" first_server="${SERVERS%% *}"
previous_manifest=$( previous_manifest=$(
envsubst <<EOF | ssh -T "root@$first_server" envsubst <<EOF | ssh -T "root@$first_server"
if [[ -f "$GCROOTDIR/$NAME.yml" ]]; then if [[ -f "$GCROOTDIR/$NAME.yml" ]]; then
cat "$GCROOTDIR/$NAME.yml" cat "$GCROOTDIR/$NAME.yml"
fi fi
EOF EOF
) )
@ -47,6 +28,7 @@ echo Uploading closure...
for server in $SERVERS; do for server in $SERVERS; do
echo Uploading closure to "$server"... echo Uploading closure to "$server"...
nix copy --to "ssh://root@$server.dmz" "$MANIFEST" nix copy --to "ssh://root@$server.dmz" "$MANIFEST"
ssh "root@$server.dmz" "mkdir -p $GCROOTDIR && ln -sf $MANIFEST $GCROOTDIR/${NAME}.yml"
done done
echo Applying Kubernetes manifest... echo Applying Kubernetes manifest...
@ -56,13 +38,3 @@ vals eval -fail-on-missing-key-in-map <"$MANIFEST" |
--prune \ --prune \
--applyset applyset-"$NAME" \ --applyset applyset-"$NAME" \
--namespace "$NAMESPACE" --namespace "$NAMESPACE"
echo Creating GC roots
for server in $SERVERS; do
ssh "root@$server.dmz" "mkdir -p $GCROOTDIR && ln -sf $MANIFEST $GCROOTDIR/${NAME}.yml"
done
if $CREATE_LOCAL_GCROOT; then
mkdir -p ./.manifests
ln -sf "$MANIFEST" "./.manifests/${NAME}.yml"
fi

View file

@ -1,7 +1,7 @@
{servers, ...}: let {servers, ...}: let
globals = { globals = {
images = { images = {
jellyfin = "jellyfin/jellyfin:10.10.5"; jellyfin = "jellyfin/jellyfin:10.10.4";
atuin = "ghcr.io/atuinsh/atuin:18.4.0"; atuin = "ghcr.io/atuinsh/atuin:18.4.0";
postgres14 = "postgres:14"; postgres14 = "postgres:14";
kms = "teddysun/kms:latest"; kms = "teddysun/kms:latest";

View file

@ -8,7 +8,7 @@ inputs @ {
flake-utils.lib.eachDefaultSystem flake-utils.lib.eachDefaultSystem
(system: let (system: let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) lib; lib = pkgs.lib;
deployScript = (pkgs.writeScriptBin "applyset-deploy.sh" (builtins.readFile ./applyset-deploy.sh)).overrideAttrs (old: { deployScript = (pkgs.writeScriptBin "applyset-deploy.sh" (builtins.readFile ./applyset-deploy.sh)).overrideAttrs (old: {
buildCommand = "${old.buildCommand}\npatchShebangs $out"; buildCommand = "${old.buildCommand}\npatchShebangs $out";
}); });