Add nixos and bootstrapping as submodules. Automate apitokens.
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."
|
||||
|
||||
if [ $# = 0 ]; then
|
||||
echo "usage: deploy.sh name ..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $1/deployment.nix ]; then
|
||||
if [ ! -f $DIR/clusters/$1/default.nix ]; then
|
||||
echo "error: $1 does not contain a deployment"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p $1/gcroots
|
||||
# mkdir -p $1/gcroots
|
||||
|
||||
echo "--- Securing certifiates"
|
||||
nix-build -o $1/gcroots/certs $1/build.nix
|
||||
# echo "--- Securing certifiates"
|
||||
# nix-build -o $1/gcroots/certs $1/build.nix
|
||||
|
||||
echo "--- Updating deployment"
|
||||
nixops modify -d $1 $1/deployment.nix
|
||||
nixops modify -d $1 $DIR/clusters/$1
|
||||
|
||||
echo "--- Deploying $1"
|
||||
nixops deploy -d $* --allow-reboot
|
||||
|
||||
Reference in New Issue
Block a user