I am trying to upgrade our workflow to develop automate code to a git-flow workflow (https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) and I was wondering if someone already did it and can point me to some resources on their solution.
I have a rough idea on how it could work, but it would require quite a bit of scripting to do it, therefore I thought I’d ask the community first, to validate my assumptions and get another opinion. The main problems I am facing are:
- There is no way to export or import on a more granular level than a single automate domain.
- Since higher priority domains overwrite everything from lower priority domains, any domain modeling a feature-branch MUST only contain changed files.
- I cannot use the git-import feature for feature-branches, because I need to import a dirty working copy.
A bit of Background:
At the moment we have a DEV-Cloudforms and a PROD-Cloudforms appliance. Every week we do an export from DEV, commit the whole export to git and import the same commit PROD.
All the development happens in the WebUI and we want to have the possibility to do small changes in the UI (espacially changes in dialogs, etc.)
- At the moment git is just a documentation tool. There is no save way to contribute via git and not have that change overwritten or producing a merge-conflict.
- All the code is pushed to PROD all the time, If a change is not yet ready for production, it has do be manually disabled in code ( e.g. with an if-statement) before the export and enabled again after the export. => Doing a production deployment at the wrong time could break everything
- This process is against all coding best practices
- Have a complicated git repo, with at least 3 types of branches.
- release-branches: one for PROD and one for DEV
- helper-branches: this is where automated commits go
- feature-branches: this is where humans work
- Export everything from DEV
- do really small commits (e.g. for each class) to the helper-branches
- at this point all the manual changes are in the helper-branches
- merge the helper-branches to the relese branches
- Import PROD
- release-branches should work fine
- import feature-branches, after removing all unchanged files
- create new branches as needed and prune old ones
- automatically maintain all the branches
- keep all the merges free from any possible conflicts
As I said, the goal for this post is to validate my assumptions and to see if someone has already done something similar already. The rest is just background information and my thoughts on the topic.