Alex, Do you multiple jobs for every branch in the repo? A different Jenkinsfile for each job type?
There are a couple of options that I can think of: 1. You can use the env.BRANCH_NAME to determine what steps happen in the Pipeline. 2. You could use the commit message on the branch to determine what part(s) of the Pipeline to execute. 3. A quick and dirty hack would be to use the "Replay" feature of the Pipeline Job to change the steps in the Pipeline. For each of these you could have each different job defined in a separate file and use the 'load' command in your Jenkinsfile to execute the different job based on the criteria of the branch, message, etc. Alternatively, you can have a primary Jenkinsfile that executes your primary pipeline for every branch and a separate standalone Pipeline job that loads the job definition from a different file in the same repo. This won't create a separate job with a unique job history for every branch in the repo but it allow you to have multiple Pipeline jobs for a single repo with the job definitions all stored within the repo. On Tue, Jun 28, 2016 at 10:23 AM, Alex Ehlke <alex.eh...@tophat.com> wrote: > We've been interested in having multiple "pipelines" per repo primarily > for operational tasks that are independent of delivery. A couple examples: > daily logical backups; some jobs that are manually triggered to manage > production services in the event of an outage. If it's the case that > Jenkinsfile isn't meant to address these types of jobs (which would > otherwise make sense to live within the repo whose service they pertain > to), then it's disappointing to lose out on its way of defining jobs. It'd > be great to have one way to define jobs whether or not they're in a repo's > (or branch's) singular pipeline, rather than relying on a combination of > Jenkinsfile and Netflix's Job-DSL for other jobs, for instance, and ending > up with disparate job DSLs. > > Is there something I'm missing? Is there a way to define "standalone" jobs > with the same DSL that Jenkinsfile uses? Or are those left to remain > outside of source control (or to some entirely different tool)? > > On Monday, May 30, 2016 at 7:14:53 PM UTC-4, Michael Neale wrote: >> >> One jenkinsfile is one "pipeline" - what you may have done with many jobs >> in the past can be done with one pipeline. it can be quite rich if you need >> it to be. >> >> You can call other "jobs" from a Jenkinsfile, but I am not sure if that >> is what you mean. >> >> >> >> On Monday, May 30, 2016 at 3:47:40 AM UTC+10, Bartłomiej Sacharski wrote: >>> >>> I'm really hyped about the Jenkinsfiles - they make it much much easier >>> to document and preserve project configuration. >>> However, all the examples that I've seen seem to use single pipeline. >>> I've tried to define different stages in separate node blocks, however >>> they still were seen as a single pipeline. >>> >>> Is it possible to define multiple pipelines in a single Jenkinsfile? Or >>> maybe there's undocumented functionality for .jenkinsfile extension to >>> handle such cases? >>> >> -- > 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-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/b4f6e051-1cf7-4455-be12-9c7a52366b9e%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/b4f6e051-1cf7-4455-be12-9c7a52366b9e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Patrick Wolf Product Director - Jenkins CloudBees -- 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-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAGDV0P_Aoje%3DSE8U6zZZqxVp6jJ%3DYbBAya8%3DSetrWZ2QEeCOig%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.