67 lines
2.2 KiB
Markdown
67 lines
2.2 KiB
Markdown
# Deploy ERPNext v16
|
||
|
||
## 1. Prepare the app
|
||
|
||
From the development bench, export fixtures and update translations.
|
||
|
||
```bash
|
||
bench --site development.localhost export-fixtures --app manufacturing_utilities
|
||
bench generate-pot-file --app manufacturing_utilities
|
||
bench update-po-files --app manufacturing_utilities
|
||
```
|
||
|
||
Edit the `msgstr` entries in the app’s `locale/de.po`, then compile.
|
||
|
||
```bash
|
||
bench compile-po-to-mo --app manufacturing_utilities
|
||
```
|
||
|
||
From the app repo, stage the app changes, fixtures, and translation sources, then commit and push.
|
||
|
||
```bash
|
||
git commit -m "Prepare ERPNext update"
|
||
git push
|
||
```
|
||
|
||
## 2. Build and push on the Mac
|
||
|
||
Run the existing build script for `linux/amd64`. Keep `libcups2-dev` and `pycups` baked into the image.
|
||
|
||
```bash
|
||
./build.sh # Default ERPNext version tag
|
||
# ./build.sh --tag 16.55.0-custom # Optional custom tag
|
||
docker push git.prothmann.com/christian/erpnexthp:TAG
|
||
```
|
||
|
||
Replace `TAG` with the tag produced by the build.
|
||
|
||
## 3. Deploy on hyp1
|
||
|
||
Update `frappe_docker` and regenerate the base Compose file.
|
||
|
||
```bash
|
||
git -C /srv/docker/frappe_docker-source pull
|
||
cd /srv/docker/erpnext-16-prod
|
||
|
||
DB_PASSWORD=COMPOSE_TEMPLATE_ONLY docker compose --env-file .env \
|
||
-f /srv/docker/frappe_docker-source/compose.yaml \
|
||
-f /srv/docker/frappe_docker-source/overrides/compose.mariadb.yaml \
|
||
-f /srv/docker/frappe_docker-source/overrides/compose.redis.yaml \
|
||
config > docker-compose.yml.tmp && mv docker-compose.yml.tmp docker-compose.yml
|
||
```
|
||
|
||
Record the previous image tag and set `CUSTOM_TAG=TAG` in `.env` to the tag you pushed. The local override supplies the production DB password. Validate the merged config before pulling.
|
||
|
||
```bash
|
||
docker compose -f docker-compose.yml -f docker-compose.override.yml config --quiet
|
||
docker compose pull
|
||
docker compose up -d
|
||
docker compose exec backend bench --site erp.prothmann.com migrate
|
||
docker compose exec backend bench --site erp.prothmann.com clear-cache
|
||
docker compose ps
|
||
```
|
||
|
||
Confirm the services are running, then log in at `erp.prothmann.com` and open Manufacturing Overview.
|
||
|
||
**Rollback.** Restore the previous `CUSTOM_TAG` and repeat `docker compose pull` and `docker compose up -d`. If migrations made incompatible database changes, restore the pre-deployment backup as well.
|