From 31f044fab746434f08ede68c768367d85eb05885 Mon Sep 17 00:00:00 2001 From: "AzureAD\\AniketSaha" Date: Tue, 8 Jul 2025 16:30:28 +0200 Subject: [PATCH] Updated script, removed docker settings --- update_hmi.sh | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/update_hmi.sh b/update_hmi.sh index ae46113..d1506cb 100644 --- a/update_hmi.sh +++ b/update_hmi.sh @@ -1,19 +1,12 @@ #!/bin/bash +set -e -echo "[UPDATE] Pulling latest changes (on host)..." +echo "[UPDATE] Pulling latest code..." cd /home/hmi/Desktop/HMI || exit 1 -git pull origin main || exit 1 +git reset --hard HEAD +git pull origin main -echo "[UPDATE] Rebuilding Docker image..." -docker build -t hmi-app . || exit 1 +echo "[RESTART] Restarting HMI service..." +sudo /bin/systemctl restart hmi.service -echo "[UPDATE] Restarting container..." -docker stop hmi && docker rm hmi -docker run -d --name hmi \ - --network host \ - --privileged \ - --restart unless-stopped \ - -v /home/hmi/Desktop/HMI:/app \ - hmi-app || exit 1 - -echo "[UPDATE] Complete" +echo "[DONE] HMI updated."