0

I would like to pull a source controlled version of a Declarative Jenkinsfile into a multibranch jenkins job.

For example, I have 20 multibranch build job each building an application and deploying, each build job will have a static jenkinsfile that point to, pull and use a version controlled jenkinsfile.

This would reduce the need to make changes across all repositories when making changes

(we do use shared libraries where relevant)

Thanks in advance

  • 1
    I don't really know multibranch pipelines, but I think I miss something? Why not just putting the jenkinsfile as pipeline.groovy in the shared library and use it with @Library('xxx')_ pipelinename {.. – lvthillo Dec 01 '17 at 12:52

1 Answers1

0

You can define the whole pipeline as a global variable within a Shared Library, then you can use a single step in your Jenkinsfile, as explained here. In that way you are able to update the content of the pipeline, without updating each Jenkinsfile accross all your repositories.

Lesly Bernaola
  • 393
  • 1
  • 12