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 ##############################################################################