Re: Declarative pipelines per branch and reusable stages (keeping it DRY)

2017-04-13 Thread Andrew Bayer
That is the case, yes. And that validation is expecting to find pipeline { ... } at the top-level of the Jenkinsfile - pretty much everything else depends on that. A. On Thu, Apr 13, 2017 at 1:28 PM, Kenneth Brooks wrote: > Got a chance to play around with some of the options for DRYing out my

Re: Declarative pipelines per branch and reusable stages (keeping it DRY)

2017-04-13 Thread Kenneth Brooks
Got a chance to play around with some of the options for DRYing out my pipelines. We are already using shared libraries (#1 below) very extensively but that is for truly enterprise wide shared functionality. I think having teams write those just for steps isn't ideal. They don't want the extra

Re: Declarative pipelines per branch and reusable stages (keeping it DRY)

2017-04-13 Thread Kenneth Brooks
Created a bug for it with evidence and jenkins plugin info: https://issues.jenkins-ci.org/browse/JENKINS-43576 On Wednesday, April 12, 2017 at 6:48:06 PM UTC-4, Kenneth Brooks wrote: > > Quickly trying out your suggestion of pipeline directly inside the if. It > sees the stages, but something is

Re: Declarative pipelines per branch and reusable stages (keeping it DRY)

2017-04-12 Thread Kenneth Brooks
oh, and thanks for the tip on the readTrusted! Totally missed that one, and yes, load is problematic because it requires the workspace (and thus a node) On Wednesday, April 12, 2017 at 4:53:23 PM UTC-4, Patrick Wolf wrote: > > Feel free to open a JIRA ticket but I'm not a huge fan of this because

Re: Declarative pipelines per branch and reusable stages (keeping it DRY)

2017-04-12 Thread Kenneth Brooks
Quickly trying out your suggestion of pipeline directly inside the if. It sees the stages, but something is not right. It doesn't see/execute the environment section (which means the use of credentials('cred') isn't being loaded. Here is what I see when the pipeline {} is on it's own: [Pipeline

Re: Declarative pipelines per branch and reusable stages (keeping it DRY)

2017-04-12 Thread Patrick Wolf
Feel free to open a JIRA ticket but I'm not a huge fan of this because it is counter to the KISS principle we wanted with Declarative and breaks the Blue Ocean editor. We have discussed having multiple "stages" blocks but rejected that because it quickly becomes needlessly complex without addin

Re: Declarative pipelines per branch and reusable stages (keeping it DRY)

2017-04-11 Thread jerome
Up vote for the forward declaration of stage/steps and just give the assembly later on (would just invert the 3rd example, delcare implementation first then use them). -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this g

Declarative pipelines per branch and reusable stages (keeping it DRY)

2017-04-11 Thread Kenneth Brooks
TL;DR up front: *As a user, I want to have a pipeline that performs specific pipeline stages based on the branch. Recommendation: Put the when{} condition outside the pipeline{} tag.* *As a user, I want to declare my stages but have the implementation be separate so that I can reuse them in mult