Make things more configurable
This commit is contained in:
@@ -1,24 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."
|
||||
TOP="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/.."
|
||||
|
||||
if [ $# = 0 ]; then
|
||||
echo "usage: deploy.sh name ..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $DIR/clusters/$1/default.nix ]; then
|
||||
if [ ! -f $TOP/clusters/$1/default.nix ]; then
|
||||
echo "error: $1 does not contain a deployment"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# mkdir -p $1/gcroots
|
||||
cd $TOP/clusters/$1
|
||||
|
||||
# echo "--- Securing certifiates"
|
||||
# nix-build -o $1/gcroots/certs $1/build.nix
|
||||
|
||||
echo "--- Updating deployment"
|
||||
nixops modify -d $1 $DIR/clusters/$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 -d $* --allow-reboot
|
||||
|
||||
Reference in New Issue
Block a user