jenkins-x / draft-packs

Note these build packs are moving to https://github.com/jenkins-x-buildpacks
https://jenkins-x.io/architecture/build-packs/
Apache License 2.0
18 stars 45 forks source link

Build feature branches in Maven-based draft packs #84

Open benvandenberg opened 6 years ago

benvandenberg commented 6 years ago

This pull request is a request for feedback on how the Jenkinsfile has been restructured for Maven-based draft packs. I recognize that there is a desire to move to prow commands, and that there are a lot of opinions on how to structure a build pipeline, and so this PR may not go anywhere.

The previous pipeline flow used stages to control conditional execution of steps. For example, a build stage existed for PR branches, and another build stage existed for master. Here is an example (note that an Acceptance Tests stage was added when I was experimenting with it):

image

Feature branches were not being built using the Jenkinsfile, which was fixed; in addition to building all branches, the file was re-worked so that each stage feeds into the next stage like a pipeline, where all branches go through a pre-build stage, then a build stage, etc. The conditional execution is controlled within the stage.

image

michaelneale commented 6 years ago

I like this - I don't know the ins and outs of the intention of maven with Jenkins X - but knowing a tiny bit about pipeline, this does seem fairly idiomatic. I imagine there are advantages to buildign feature branches - but wont this create more builds before a PR is actually opened? is this a problem?

cc @rawlingsj @jstrachan does this look ok to you?