diff options
author | EuAndreh <eu@euandre.org> | 2021-03-07 23:43:53 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-03-07 23:43:53 -0300 |
commit | e919e3de36f36ce0a4c27782b677e0f3fa5a7ed7 (patch) | |
tree | ce7f9567f24ab2d7b48f98a3ea8c3ce48f7d7bb0 /scripts/deploy | |
parent | servers/vps/machines.scm: Remove initialization of /srv forlders, done in scr... (diff) | |
download | toph-e919e3de36f36ce0a4c27782b677e0f3fa5a7ed7.tar.gz toph-e919e3de36f36ce0a4c27782b677e0f3fa5a7ed7.tar.xz |
scripts/deploy: Switch on OS type only once
Diffstat (limited to 'scripts/deploy')
-rwxr-xr-x | scripts/deploy | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/scripts/deploy b/scripts/deploy index b0797be..5c26030 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -15,15 +15,6 @@ fi DIR="$(dirname "$FILE")" -if [ -f "$DIR"/machines.scm ]; then - OS=guix -elif [ -f "$DIR"/configuration.nix ]; then - OS=nix -else - printf 'Uknown OS type of "%s"\n' "$NAME" >&2 - exit 2 -fi - terraform apply "$DIR" TLD="$(cat "$DIR"/tld.txt)" @@ -36,9 +27,12 @@ chmod -R 755 $DIRS" rsync -avzP opt "$TLD":/ -if [ "$OS" = 'guix' ]; then +if [ -f "$DIR"/machines.scm ]; then guix deploy "$DIR"/machines.scm -elif [ "$OS" = 'nix' ]; then +elif [ -f "$DIR"/configuration.nix ]; then scp "$DIR"/configuration.nix "$TLD":/etc/nixos/ ssh "$TLD" sudo nixos-rebuild switch +else + printf 'Uknown OS type of "%s"\n' "$NAME" >&2 + exit 2 fi |