2025-12-22 13:12:06 +01:00
|
|
|
# Quick Update Guide - BMC Hub Production
|
|
|
|
|
|
|
|
|
|
## Første gang (installer updateto.sh script)
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
ssh bmcadmin@172.16.31.183
|
|
|
|
|
cd /srv/podman/bmc_hub_v1.0
|
|
|
|
|
|
2025-12-22 13:13:45 +01:00
|
|
|
# Download deployment script fra Gitea
|
|
|
|
|
curl -O https://g.bmcnetworks.dk/ct/bmc_hub/raw/branch/main/updateto.sh
|
2025-12-22 13:12:06 +01:00
|
|
|
chmod +x updateto.sh
|
|
|
|
|
|
|
|
|
|
# Nu kan du bruge scriptet
|
|
|
|
|
./updateto.sh v1.3.16
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Næste gang (når scriptet allerede er installeret)
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
ssh bmcadmin@172.16.31.183
|
|
|
|
|
cd /srv/podman/bmc_hub_v1.0
|
|
|
|
|
./updateto.sh v1.3.16
|
|
|
|
|
```
|
|
|
|
|
|
2026-05-17 23:05:22 +02:00
|
|
|
## Fast small update (kode-only, uden ny release tag)
|
|
|
|
|
|
|
|
|
|
Brug denne metode til meget små ændringer i `app/*` eller `main.py`, hvor du ikke vil lave en fuld release-pakke.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
ssh bmcadmin@172.16.31.183
|
|
|
|
|
cd /srv/podman/bmc_hub_v1.0
|
|
|
|
|
|
|
|
|
|
# Download/refresh fast update script
|
|
|
|
|
curl -O https://g.bmcnetworks.dk/ct/bmc_hub/raw/branch/main/update_fast.sh
|
|
|
|
|
chmod +x update_fast.sh
|
|
|
|
|
|
|
|
|
|
# Tjek først hvad der ændres (anbefalet)
|
|
|
|
|
./update_fast.sh --ref main --dry-run --allow-prod
|
|
|
|
|
|
|
|
|
|
# Kør fast update (eksempel: specifik commit)
|
|
|
|
|
./update_fast.sh --ref 08f4097 --allow-prod
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Vigtigt:
|
|
|
|
|
- `update_fast.sh` er kun til kode/templates/static ændringer i fast scope.
|
|
|
|
|
- Hvis der er ændringer i migrationer, dependencies, docker/compose eller env: brug `./updateto.sh`.
|
|
|
|
|
- Rollback kan køres med backup-id:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
./update_fast.sh --rollback 20260517-142155 --allow-prod
|
|
|
|
|
```
|
|
|
|
|
|
2025-12-22 13:12:06 +01:00
|
|
|
## Manuel deployment (hvis scriptet ikke virker)
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cd /srv/podman/bmc_hub_v1.0
|
|
|
|
|
|
|
|
|
|
# Opdater .env
|
|
|
|
|
nano .env # Sæt RELEASE_VERSION=v1.3.16
|
|
|
|
|
|
|
|
|
|
# Deploy
|
|
|
|
|
podman-compose down
|
|
|
|
|
podman-compose up -d --build
|
|
|
|
|
podman logs -f bmc-hub-api-prod
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Sync efter deployment
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# 1. Sync e-conomic (PRIMARY SOURCE - opretter alle kunder)
|
|
|
|
|
curl -X POST http://localhost:8000/api/v1/system/sync/economic
|
|
|
|
|
|
|
|
|
|
# 2. Sync vTiger (linker vTiger IDs til eksisterende kunder)
|
|
|
|
|
curl -X POST http://localhost:8000/api/v1/system/sync/vtiger
|
|
|
|
|
```
|