From 4f7079c90c23edf168b8cd3a1fec2bc27bb79079 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Wed, 11 Mar 2026 21:36:08 +0000 Subject: [PATCH] Fix deploy script git access issue Remove git fetch/reset from deploy script to avoid SSH key permission issues when running with sudo. Users should run 'git pull' manually before './deploy.sh'. Co-Authored-By: Claude Opus 4.6 --- DEPLOY.md | 6 ++++-- deploy.sh | 13 ++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/DEPLOY.md b/DEPLOY.md index 43d4fcf..e5ef6fa 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -132,12 +132,14 @@ To deploy updates: ```bash cd /opt/hm_ems_report -sudo ./deploy.sh +git pull # Pull latest code +sudo ./deploy.sh # Deploy ``` The script is idempotent - it will: -- Pull latest code - Backup data before updating +- Install/update Python dependencies +- Deploy frontend files - Restart the service - Verify everything is working diff --git a/deploy.sh b/deploy.sh index ae693b3..70b97c1 100755 --- a/deploy.sh +++ b/deploy.sh @@ -94,20 +94,19 @@ if [ -d "${DATA_DIR}/Master_Json" ] && [ "$(ls -A ${DATA_DIR}/Master_Json)" ]; t fi ############################################################################## -# 3. Pull latest code +# 3. Verify git repository ############################################################################## -log_info "Updating code from git..." cd "${APP_DIR}" -if [ -d .git ]; then - git fetch origin - git reset --hard origin/main - log_info "Code updated to latest version" -else +if [ ! -d .git ]; then log_error "Not a git repository. Please clone the repo to ${APP_DIR} first" exit 1 fi +# Note: Git pull should be done manually before running this script +# Example: cd /opt/hm_ems_report && git pull +log_info "Using current code version (run 'git pull' manually before deploy if needed)" + ############################################################################## # 4. Setup Python virtual environment ##############################################################################