revamp nixops structure(s)

This commit is contained in:
Jonas Juselius
2022-08-19 15:33:10 +02:00
parent ece1b22711
commit cf956c739e
86 changed files with 8 additions and 2644 deletions

27
nixops/bin/deploy.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
TOP="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/.."
if [ $# = 0 ]; then
echo "usage: deploy.sh name ..."
exit 1
fi
if [ ! -f $TOP/$1/default.nix ]; then
echo "error: $1 does not contain a deployment"
exit 1
fi
cd $TOP/$1
nixops list | grep -q $1
if [ $? = 0 ]; then
echo "--- Updating deployment"
nixops modify -d $1 .
else
echo "--- Creating deployment"
nixops create -d $1 .
fi
echo "--- Deploying $1"
nixops deploy -k -d $* --allow-reboot