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 <noreply@anthropic.com>
This commit is contained in:
parent
75d5519215
commit
4f7079c90c
2 changed files with 10 additions and 9 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
13
deploy.sh
13
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
|
||||
##############################################################################
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue