I am managing a fairly extensive Jenkins infrastructure and want to streamline some of our development processes.
The first idea comes from one of our retiring systems where builds were created, tested, and then released. The artifacts created by the build are deployed to our download location (S3) and the Git commit that created them are tagged. Having moved the building into Jenkins, we’ve lost this process. I suspect that the promoted-builds-plugin might fit the bill, except that it currently does not support pipeline jobs. Is there a means of doing this within pipeline code?
The second idea takes the first and wraps it up in a Git Flow style of releasing code. While we can use Git Flow as a process, our repositories in GitHub are using branch protection rules that prevent automated merges as the Flow progresses. Except that I’ve allowed our Jenkins infrastructure to override the rules. So, does anybody have examples of letting a Jenkins job create merges and push changes to Git repositories?
Since pipeline is code, and it can execute shell – there is virtually nothing you can’t replicate with it, as long as the task does not involve extremely obscure 3rdparty clear services without API.
I am unsure if there would be any concrete solution to your question, but my general advice would be to not cling to the plugins and see if you can write some custom tools (scripts, Python, Java apps, whatever dev resources you have at hand) to do what is needed. Nothing prevents you from doing this in your pipeline:
If you need more complex logic – be not afraid to ditch raw shell and f.x. use Python instead:
if (someCondition) {
sh("""ci/merge.py --target ${someTargetBranch} --message "${someMessage}" """)
}
My personal preference of moving stuff into Python tools – is that you’d have an easier time debugging and testing your Python locally without involving Jenkins at all. Pipeline’s Groovy can be abstracted away into shared libraries, but testing those is rather frustrating.
If you got more specific questions in mind – fire away!