infra/deploy
zimbatm c989fbe2c7
nixos: set default deployment and state in the shell
This makes it easier to play with nixops. Eg: `nixops ssh build01`
2020-01-12 17:12:35 +01:00

11 lines
296 B
Text
Executable file

#!/usr/bin/env nix-shell
#! nix-shell ./shell.nix -i bash
set -euo pipefail
mkdir -p state
if [ $(nixops list --state "$NIXOPS_STATE" | grep -c "$NIXOPS_DEPLOYMENT") -eq 0 ]; then
nixops create ./deployment.nix --deployment "$NIXOPS_DEPLOYMENT" --state "$NIXOPS_STATE"
fi
nixops deploy "$@"