diff --git a/app/README.md b/app/README.md index b8d2fda..98de4e3 100644 --- a/app/README.md +++ b/app/README.md @@ -4,7 +4,7 @@ You just need to make a "nose" user on your RPi and make sure you can ssh in. -Then run `bun deploy && bun remote:install`. +Then run `bun remote:install`. When it's done (it'll reboot) visit: diff --git a/app/scripts/deploy.sh b/app/scripts/deploy.sh index f7f86bd..d925afa 100755 --- a/app/scripts/deploy.sh +++ b/app/scripts/deploy.sh @@ -1,3 +1,13 @@ #!/usr/bin/env bash -source ./app/scripts/config.sh +set -e + +# Get absolute path of this script’s directory +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ROOT_DIR="$SCRIPT_DIR/../.." + +# Run deploy + config with absolute paths +source "$ROOT_DIR/app/scripts/deploy.sh" +source "$ROOT_DIR/app/scripts/config.sh" + +# Run remote install on the target ssh $HOST "cd $DEST && git pull && bun install && sudo systemctl restart nose-pluto.service" \ No newline at end of file diff --git a/app/scripts/remote-install.sh b/app/scripts/remote-install.sh index 2a4cc55..7f1fd8b 100755 --- a/app/scripts/remote-install.sh +++ b/app/scripts/remote-install.sh @@ -1,3 +1,13 @@ #!/usr/bin/env bash -source ./app/scripts/config.sh -ssh $HOST "cd $DEST && ./app/scripts/install.sh && sudo systemctl start nose-pluto.service" \ No newline at end of file +set -e + +# Get absolute path of this script’s directory +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ROOT_DIR="$SCRIPT_DIR/../.." + +# Run deploy + config with absolute paths +source "$ROOT_DIR/app/scripts/deploy.sh" +source "$ROOT_DIR/app/scripts/config.sh" + +# Run remote install on the target +ssh "$HOST" "cd $DEST && ./app/scripts/install.sh && sudo systemctl start nose-pluto.service" diff --git a/app/scripts/remote-restart.sh b/app/scripts/remote-restart.sh index 3148b8e..cf0399e 100755 --- a/app/scripts/remote-restart.sh +++ b/app/scripts/remote-restart.sh @@ -1,3 +1,9 @@ #!/usr/bin/env bash -source ./app/scripts/config.sh -ssh $HOST "sudo systemctl restart nose-pluto.service" +set -e + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ROOT_DIR="$SCRIPT_DIR/../.." + +source "$ROOT_DIR/app/scripts/config.sh" + +ssh "$HOST" "sudo systemctl restart nose-pluto.service" diff --git a/app/scripts/remote-start.sh b/app/scripts/remote-start.sh index 3f15fb4..bc91e5a 100755 --- a/app/scripts/remote-start.sh +++ b/app/scripts/remote-start.sh @@ -1,3 +1,9 @@ #!/usr/bin/env bash -source ./app/scripts/config.sh -ssh $HOST "sudo systemctl start nose-pluto.service" \ No newline at end of file +set -e + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ROOT_DIR="$SCRIPT_DIR/../.." + +source "$ROOT_DIR/app/scripts/config.sh" + +ssh "$HOST" "sudo systemctl start nose-pluto.service" diff --git a/app/scripts/remote-stop.sh b/app/scripts/remote-stop.sh index 24f65b6..36176d5 100755 --- a/app/scripts/remote-stop.sh +++ b/app/scripts/remote-stop.sh @@ -1,3 +1,9 @@ #!/usr/bin/env bash -source ./app/scripts/config.sh -ssh $HOST "sudo systemctl stop nose-pluto.service" +set -e + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ROOT_DIR="$SCRIPT_DIR/../.." + +source "$ROOT_DIR/app/scripts/config.sh" + +ssh "$HOST" "sudo systemctl stop nose-pluto.service"