-
New Feature
-
Resolution: Duplicate
-
Minor
-
None
With the 1.0 release of model definition, we are defining the entire pipeline job as code. However, there is no standard as far as I am aware for sharing multiple Jenkinsfile(s) in an organization in git repository. There is definitely a use case for this, along with existing examples.
This would be a logical extension for shared libraries and the directory structure perhaps by adding a 'pipelines/' folder. These could appear in a drop down when creating a pipeline job (not multibranch). One way would be to have a 'Pipeline Script from Library' option similar to the 'Pipeline Script from SCM' option.
A future extension could be to automatically generate Jenkins jobs from pipelines in a library. Right now, this can be done using the CLI as used in this github project.
1) Create a template pipeline XML with the Git repo and the pipeline definition file paths embedded.
2) Import as a pipeline job:
java -jar jenkins-cli.jar -s http://localhost:8080 create-job pipeline < pipeline.xml
- duplicates
-
JENKINS-42224 Need ability to create reusable chunks of Declarative Pipeline
- Open