diff --git a/deploy/run.sh b/deploy/run.sh index 5a6211c..1b80530 100644 --- a/deploy/run.sh +++ b/deploy/run.sh @@ -3,6 +3,7 @@ set -euo pipefail cd "$(dirname "$0")" host="root@hub.hordelab.com" +remote_path="/var/horde/hub/" run_nginx() { echo "Uploading nginx config file" @@ -43,6 +44,12 @@ run_update() { " } +run_dist() { + echo "Uploading frontend/dist to $host:/var/frontend/dist" + ssh "$host" "rm -rf $remote_path/frontend/dist && mkdir $remote_path/frontend/dist" + scp -r ../frontend/dist "$host:$remote_path/frontend/" +} + restart_service() { echo "Restarting horde-hub.service" ssh "$host" -t "systemctl restart horde-hub.service" @@ -50,6 +57,7 @@ restart_service() { # Determine which stages to run stages=() +do_restart=0 if [[ $# -eq 0 ]]; then # Interactive prompts when no arguments are given read -p "Run nginx deployment? [Y/n] " choice @@ -70,8 +78,12 @@ else # Parse arguments for arg in "$@"; do case "$arg" in - nginx|service|update) + nginx|service|update|dist) stages+=("$arg") + do_restart=1 + ;; + --dist) + stages+=("dist") ;; *) echo "Unknown argument: $arg" >&2 @@ -87,8 +99,9 @@ for stage in "${stages[@]}"; do nginx) run_nginx ;; service) run_service ;; update) run_update ;; + dist) run_dist ;; esac done # Final stage: always restart the systemd service at the end -restart_service \ No newline at end of file +if [[ $do_restart -eq 1 ]]; then restart_service; fi diff --git a/frontend/src/components/Message.vue b/frontend/src/components/Message.vue index a76bf22..a14df50 100644 --- a/frontend/src/components/Message.vue +++ b/frontend/src/components/Message.vue @@ -1,5 +1,5 @@