For example:
I have 30 multi-faceted Git projects. All projects have their own Jenkins file. And suddenly I find the cool Jenkins plugin that I want to add for all projects. It is a pain to do this in all projects, and it is a big waste of time.
Is it possible to create some kind of Jenkinsfile template that will be something like a wrapper for the Jenkinsfile project or something like that gives me the ability to make changes in 1 place instead of 30 places?
I want something like this:
stage { ...} timestamps { <include rest of stages definied in projects> } stage { ... }
The template file that is in some repo looks like this. All projects have their own stages, which are defined in the middle of the Jenkinsfile template and defined in the project.
So, the Jenkins file in the project should:
- download template from repository
- put the steps in the middle of the Jenkinsfile template
jenkins jenkins-pipeline
Kapitalny
source share