18 lines
591 B
Text
Executable file
18 lines
591 B
Text
Executable file
#!/usr/bin/env nix-shell
|
|
#! nix-shell ./shell.nix -i bash
|
|
set -euo pipefail
|
|
|
|
options=(
|
|
--option extra-substituters "https://nix-community.cachix.org"
|
|
--option binary-cache-public-keys "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
)
|
|
|
|
mkdir -p state
|
|
|
|
if [ $(nixops list --state "$NIXOPS_STATE" | grep -c "$NIXOPS_DEPLOYMENT") -eq 0 ]; then
|
|
nixops create ./deployment.nix \
|
|
"${options[@]}" \
|
|
--deployment "$NIXOPS_DEPLOYMENT" --state "$NIXOPS_STATE"
|
|
fi
|
|
|
|
nixops deploy "${options[@]}" "$@"
|