Do you really have to use multi-branch pipeline to do pipeline as code?

42 views
Skip to first unread message

Tim Black

unread,
Oct 29, 2019, 12:21:19 AM10/29/19
to Jenkins Users
Just double checking this, at the below link it says the only way to use pipeline as code is to use the multi Branch pipeline configuration. Is this really true?

https://jenkins.io/doc/book/pipeline-as-code/

I thought perhaps there was a way to configure a job that doesn't monitor for branches and create corresponding jobs, but simply pulls a Jenkins file from SCM.

Perhaps this behavior I describe is just a subset of what multi-branch pipeline can do? So to achieve my simple behavior I just use multi-branch Pipeline and configure it to not monitor for new branches?

Mark Waite

unread,
Oct 29, 2019, 12:41:49 AM10/29/19
to Jenkins Users
The pipeline as code page teaches users how to automate the creation, execution, and deletion of pipeline jobs based on the creation and deletion of jobs.

You're welcome to define a pipeline job that include the pipeline definition in the job or you can define a pipeline job that reads the job definition from SCM.  Those two techniques won't automatically create and destroy jobs based on branches, but they are allowed and supported by Jenkins.

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c45794e2-bb73-4b06-b450-a6cfef76b15f%40googlegroups.com.


--
Thanks!
Mark Waite

Tim Black

unread,
Oct 29, 2019, 11:54:03 AM10/29/19
to Jenkins Users
Thanks Mark. Of course you're correct. My main problem and point to make here (and with Jenkins ecosystem in general) is that the documentation says you have to use multi-branch pipeline to use pipeline as code, whereas this is patently false. I see in my freestyle pipeline job configuration that there is an option when specifying the pipeline to use scm. This is clearly also pipeline as code.

Also minor correction in your first paragraph, I believe you mean creation and deletion of branches.

Thanks again. I'm curious to see if people have comments or feedback on Jenkins pipeline documentation. Is there a better place than where I have linked to above for finding this kind of information?

Mark Waite

unread,
Oct 29, 2019, 12:57:42 PM10/29/19
to Jenkins Users
There is a link at the bottom of each page, "Improve this page".  We welcome contributions to the Jenkins pipeline documentation.

Yes, you're correct that I should have said:

The pipeline as code page teaches users how to automate the creation, execution, and deletion of pipeline jobs based on the creation and deletion of branches.

It depends what you mean by "a better place for finding this kind of information".  The documentation on jenkins.io is a good starting point.  It includes tutorials, how-to guides, and reference material.  Specific questions are asked and answered on mailing lists, in the chat systems, on Q&A sites like stackoverflow, and in blog posts on many locations.  Videos are available from YouTube and other locations, including segments like the "Jenkins Minute" video series.  Self-paced courses are available from CloudBees, Udemy, and other online course systems.  Jenkins Pipeline Fundamentals from CloudBees is no charge (as one example).

--
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 jenkinsci-use...@googlegroups.com.


--
Thanks!
Mark Waite

Tim Black

unread,
Nov 7, 2019, 11:02:17 AM11/7/19
to Jenkins Users
Thanks Mark. I created a simple change for review: https://github.com/jenkins-infra/jenkins.io/pull/2631
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins...@googlegroups.com.


--
Thanks!
Mark Waite
Reply all
Reply to author
Forward
0 new messages