I'm having a hard time understanding how exactly the concept of promoting builds (and their artifacts) works together with GitFlow. I'm in the process of working out a continuous integration/delivery workflow with Git, Jenkins and (as a new addition) Artifactory. This is what I have worked out so far:
- Build artifacts from the
developbranch will automatically be pushed to adevrepo (if unit tests etc. pass) and therefore promoted to adevstatus. Further promotions are not possible for these artifacts. - Artifacts from
featurebranches don't get pushed or promoted at all. - Artifacts from the
releasebranch can also only be promoted todev(or should I introduce areleaserepo?) - As soon as
releaseis merged intomaster, the new commit is tagged and Jenkins runs the full CI/CD pipeline. After unit tests and metrics (build stages which are run on all branches) the artifact is pushed to amasterrepo and promoted tomaster. Then the artifact is used for deployment to a staging environment, where final testing can be made (these tests can be automated in a full continuous deployment setup). If all tests are successful, the artifact will be pushed to aprodrepo, deployed to production and promoted toprodstatus. If any stage until production fails, the tag belongs to a version, that never made it to production.
Is my understanding correct? I'm mostly confused about the master/release merging. Intuitively I would have said, that the binaries from release would undergo the most testing. However, GitFlow dictates that only commits on master get tagged (and I don't want to tag commits that technically did not produce the binaries which land in production). What if problems are found during the build of the commit on master? Is it "wrong" to have tags, which did not make it to production? Do I have to revert or undo the tag or even the merge commit?
It would be nice to hear other peoples approach to this build promotion + GitFlow thing. Any help is much appreciated.