From e919e3de36f36ce0a4c27782b677e0f3fa5a7ed7 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 7 Mar 2021 23:43:53 -0300 Subject: scripts/deploy: Switch on OS type only once --- scripts/deploy | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'scripts/deploy') 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 -- cgit v1.2.3