Hi there,
I’ve been looking at Erpnext and I wanted to ask some more experienced users (or devs?) what would be the best way of introducing some sort of CI/CD workflow.
My main goal is to modify ERPnext and other applications in a non-invasive way (without moidfying the core structures), by adding custom fields and doctypes.
I want to have test, pre-production (staging?) and production environment. Maybe with a 4th one, the local dev.
The application would be deployed using Docker Compose, just as shown in the docs.
Here’s what I think I should be doing:
- Fork/clone erp, hrms, frappe, all the other apps from Github to my repository (at least I think I have to do it to track changes of my custom stuff?)
- Create apps.json file pointing to my repositories with the apps
- Build a docker file with this apps.json file
- Deploy built docker file as production environment
- Clone the production env into the test environment (a separate Docker installation)
- Make changes on test/dev env (inside UI), with the changes being tracked in my Git repository
- After making all the changes in test env, build a new version of the container with test env changes applied
At this point I would have a working container with changes made in the apps.
Now for the staging and final production deployment:
- Clone prod environment database to staging env, while using the new container in staging env (so “old” production database with new, test-env application). If I understand bench correctly, at this point the schema changes would get applied from the “new” application container files, to the database.
- If staging deploy works without issues, apply the new container version to production environment.
I am not at all experienced with CI/CD and using Git for production cycles, so sorry if that makes no sense at all lol.
Please let me know if I’m at least looking in a good direction.
If possible, I would also like to ask what should happen when I want to upgrade the Frappe apps in this scenario; Do I merge new changes from the Frappe Github to my repository and carry on just as these were my changes? Will (some of) my custom changes get overwritten?