We use the Jenkins pipeline as a library so our Jenkinsfile is as short as:
@Library('Jenkins-pipeline@master')_
def pipelineParams = [
agent: 'Linux',
slackChannel: 'build-dev'
]
mavenJavaPipeline pipelineParams
And the real pipeline code is in a separate repository. If you want to
change the pipeline you can use a project and change the branch of the
pipeline (master -> featurebranch) to test the changes in the library
before merging the pipeline changes back to master (effectively adjusting
all the builds that use the pipeline).
With regards,
Nick Stolwijk
~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~
Lord Baden-Powell
On Tue, Jul 21, 2020 at 11:37 PM 'Martin Schmude' via Jenkins Users <
[email protected]> wrote:
> Dear all,
>
> if I understand multibranch jobs right, then a Jenkinsfile in branch
> "master" will be replicated into all other branches drawn from "master".
> It has to be like that because the Jenkinsfile is the "marker" that tells
> Jenkins to build a branch, and how to do that. Branches without a
> Jenkinsfile will not be built.
>
> This will often result in code duplication, with all the well-known issues.
> If a small change has to be made to the Jenkinsfile, it has to be applied
> to all branches.
>
> How do you handle that issue? Is there a recommended practice?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/4ceb91fb-e271-4b1f-9026-5154d31e5823o%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/4ceb91fb-e271-4b1f-9026-5154d31e5823o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CAA9S6i526aq3zrPJSOt6aMTXQXexmmn-A2rx2B5cnWNy%2Bb5E4Q%40mail.gmail.com.