[JIRA] (JENKINS-42327) Add support for defining declarative pipeline templates in shared libraries

4 views
Skip to first unread message

abeerm@gmail.com (JIRA)

unread,
Feb 26, 2017, 2:18:02 AM2/26/17
to jenkinsc...@googlegroups.com
Abir M created an issue
 
Jenkins / New Feature JENKINS-42327
Add support for defining declarative pipeline templates in shared libraries
Issue Type: New Feature New Feature
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin, workflow-cps-global-lib-plugin
Created: 2017/Feb/26 7:17 AM
Priority: Minor Minor
Reporter: Abir M

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 ](https://github.com/fabric8io/fabric8-jenkinsfile-library).

This would be a logical extension for shared libraries and the [directory structure](https://jenkins.io/doc/book/pipeline/shared-libraries/#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](https://github.com/kitconcept/jenkins-pipeline-examples).

1) Create [a template skeleton XML](https://github.com/kitconcept/jenkins-pipeline-examples/blob/master/job-templates/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 < /home/vagrant/jenkins-pipeline-examples/pipeline.xml

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

abeerm@gmail.com (JIRA)

unread,
Feb 26, 2017, 2:21:01 AM2/26/17
to jenkinsc...@googlegroups.com
Abir M updated an issue
Change By: Abir M
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 ]( | https://github.com/fabric8io/fabric8-jenkinsfile-library ) ] .

This would be a logical extension for shared libraries and the [directory structure
]( | https://jenkins.io/doc/book/pipeline/shared-libraries/#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
]( | https://github.com/kitconcept/jenkins-pipeline-examples ) ] .

1) Create [a template
skeleton pipeline XML ]( | https://github.com/kitconcept/jenkins-pipeline-examples/blob/master/job-templates/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 < /home/vagrant/jenkins-pipeline-examples/pipeline.xml}}

abeerm@gmail.com (JIRA)

unread,
Feb 26, 2017, 2:22:02 AM2/26/17
to jenkinsc...@googlegroups.com
Abir M updated an issue
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 | https://github.com/fabric8io/fabric8-jenkinsfile-library].

This would be a logical extension for shared libraries and the [directory structure|https://jenkins.io/doc/book/pipeline/shared-libraries/#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|https://github.com/kitconcept/jenkins-pipeline-examples].

1) Create [a template pipeline XML|https://github.com/kitconcept/jenkins-pipeline-examples/blob/master/job-templates/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 < /home/vagrant/jenkins-pipeline-examples/pipeline.xml}}

abeerm@gmail.com (JIRA)

unread,
Feb 26, 2017, 2:22:02 AM2/26/17
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Feb 27, 2017, 4:42:04 PM2/27/17
to jenkinsc...@googlegroups.com
Andrew Bayer resolved as Duplicate
Change By: Andrew Bayer
Status: Open Resolved
Resolution: Duplicate

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:22 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Duplicate
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages