How to get started with pipeline jobs?

59 views
Skip to first unread message

David Aldrich

unread,
Apr 13, 2017, 7:25:49 AM4/13/17
to jenkins...@googlegroups.com

Hi

 

We use the traditional ‘Freestyle’ job style for most of our Jenkins jobs.  We also use the ‘Freestyle multi-branch project’ for some jobs.  I note that the Multi-Branch Project Plugin is now deprecated, so I think now is the time for us to seriously look at moving to Pipeline jobs.

 

The ‘New Item’ page states that a ‘Pipeline’ job ‘Orchestrates long running activities that span multiple build slaves’.  Our jobs don’t fit that description – they aren’t necessarily long and certainly don’t span multiple slaves. I guess I’m saying that we don’t need ‘staging’. Is Pipeline still the recommended way for us to go?

 

What is the best way to get started with Pipeline jobs?  Do I need to learn the scripting language or should I use Blue Ocean to generate the jobs graphically?

 

Finally, we use svn exclusively, not git.  Will that cause us any problems?

 

Best regards

 

David

 

Christopher Orr

unread,
Apr 13, 2017, 7:44:09 AM4/13/17
to jenkins...@googlegroups.com
Hi there,

On Thu, 13 Apr 2017, at 13:25, David Aldrich wrote:
> We use the traditional 'Freestyle' job style for most of our Jenkins
> jobs. We also use the 'Freestyle multi-branch project' for some jobs. I
> note that the Multi-Branch Project Plugin is now deprecated, so I think
> now is the time for us to seriously look at moving to Pipeline jobs.
>
> The 'New Item' page states that a 'Pipeline' job 'Orchestrates long
> running activities that span multiple build slaves'. Our jobs don't fit
> that description - they aren't necessarily long and certainly don't span
> multiple slaves. I guess I'm saying that we don't need 'staging'. Is
> Pipeline still the recommended way for us to go?

I guess that's not the greatest description — it describes what *is*
possible (in contrast with Freestyle), but you don't necessarily have to
do such things with it.

Pipeline is the recommended way to go, even if you don't need to
orchestrate large build pipelines, but it has a variety of other
benefits: https://jenkins.io/doc/book/pipeline/#why


> What is the best way to get started with Pipeline jobs? Do I need to
> learn the scripting language or should I use Blue Ocean to generate the
> jobs graphically?

Go through that documentation link to get a flavour of what it looks
like — you can use the newer Declarative syntax, so you don't
necessarily have to learn the Scripted syntax. Or use the Blue Ocean
visual editor; it will generate the same declarative syntax for you.


> Finally, we use svn exclusively, not git. Will that cause us any
> problems?

Nope, the SVN plugin has Pipeline support.

Regards,
Chris

David Aldrich

unread,
Apr 13, 2017, 8:08:57 AM4/13/17
to jenkins...@googlegroups.com
Hi Chris

Thanks for your answer, it was very helpful.

Regarding the SCM, in Blue Ocean I clicked 'New Pipeline' and was asked 'Where do you store your code?'. I was offered Git or Github. Does that mean I can't store a Jenkinsfile in svn?

Best regards

David
> --
> 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/1492083843.288602.943536008.703C4D92%40webmail.messagingengin
> e.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> Click
> https://www.mailcontrol.com/sr/xvYRbG2FSALGX2PQPOmvUuToodiywuSOlb
> ++fJoyXy+OtsKiyuqV!lfw2Oiz3tuYmV0!TP2mtcSNc!rJiVGaJg== to report this
> email as spam.

Christopher Orr

unread,
Apr 13, 2017, 10:13:51 AM4/13/17
to jenkins...@googlegroups.com
On Thu, 13 Apr 2017, at 14:08, David Aldrich wrote:
> Thanks for your answer, it was very helpful.
>
> Regarding the SCM, in Blue Ocean I clicked 'New Pipeline' and was asked
> 'Where do you store your code?'. I was offered Git or Github. Does that
> mean I can't store a Jenkinsfile in svn?

Ah, yeah, that particular Blue Ocean shiny new setup workflow thingy
currently only supports Git / GitHub. I have no idea whether adding SVN
is planned, but I wouldn't hold my breath. Maybe one of the developers
can chime in, or you can check JIRA for related feature requests.

But you certainly should be able to store your Jenkinsfile in SVN — when
you create a new Pipeline job (via the "classic" UI), you can choose
"Jenkinsfile from SCM" and there you should be able to point it at your
repo URL.

According to this blog post, you should even be able to use the
multibranch functionality with SVN (which I find surprising; not sure if
it's true):
https://jenkins.io/blog/2015/12/03/pipeline-as-code-with-multibranch-workflows-in-jenkins/

Regards,
Chris
> https://groups.google.com/d/msgid/jenkinsci-users/095481598a864cd18e0a213ba974adee%40EUX13SRV1.EU.NEC.COM.

David Aldrich

unread,
Apr 13, 2017, 10:25:05 AM4/13/17
to jenkins...@googlegroups.com
Thanks Chris

Best regards

David

> -----Original Message-----
> From: jenkins...@googlegroups.com [mailto:jenkinsci-
> us...@googlegroups.com] On Behalf Of Christopher Orr
> Sent: 13 April 2017 15:14
> To: jenkins...@googlegroups.com
> Subject: Re: How to get started with pipeline jobs?
>
> > > ++fJoyXy+this
> > > email as spam.
> >
> > --
> > 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/095481598a864cd18e0a213ba974adee%40EUX13SRV1.EU.NEC.COM.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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/1492092817.2557814.943680752.27C98E14%40webmail.messagingengi
> ne.com.
Reply all
Reply to author
Forward
0 new messages