[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2019-10-22 Thread bitwise...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Liam Newman closed an issue as Won't Fix  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Bulk closing resolved issues.   
 

  
 
 
 
 

 
 Jenkins /  JENKINS-41335  
 
 
  Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
Change By: 
 Liam Newman  
 
 
Status: 
 Resolved Closed  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.178111.1485193456000.17738.1571801069773%40Atlassian.JIRA.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2018-04-13 Thread florian.miedn...@vipco.de (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Florian Miedniak commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 I very agree with Liam Newman and Francis Therien: Having some background information about the underlying design would it make a lot easier to build Jenkins pipelines the "right" way: Luckily, they are actively developed, thus it is extremely important for users to know about things you should not use because they are getting obsoleted in near future due to changes / advances in design. Frankly, today it is sometimes quite challening to justify the maintenance effort for pipelines, if the answer to the question "why did the jenkins update break our pipe?" repeatedly is: "they decided to change it" ... IMO, in the recent past Jenkins came to a very good way of communicating and handling of security related issues (pre-announcement mails, changelog, ...) Having a design outline and a roadmap with milestones IMO would be a good starting point to achieve a similar level of transparency for the design of a complex, production-grade CI system that Jenkins is.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2018-04-12 Thread bitwise...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Liam Newman commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Andrew Bayer I want to be clear, I personally am willing to accept that this is not only out of scope, but also counter to core design.  My point is I'd like to make sure that core design and direction are documented and understandable.    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2018-04-12 Thread svano...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sam Van Oort commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Francis Therien Caveat: take anything I say here as a personal opinion only. By all means, people should default to Declarative (or Declarative + Shared Libraries as needs grow) because it's easier and shows an opinionated "lit path" to successful CI/CD. And yes, we devote more work to Declarative specifically – I think the split is roughly 30/60/10 for work that is Declarative-only / General Pipeline for both / Scripted-only. That's because Declarative is newer and intended to be the "easy" mechanism that covers 80% of needs, where Scripted lets you roll-your-own and the majority of the features are just General Pipeline Stuff + Groovy.  But as far as actually deprecating Scripted? You see people propose it from time to time, generally without understanding what it actually means, because Declarative is joined at the hip to Scripted and runs on top of it. For Declarative to replace Scripted, it which would have to absorb all the crazy use cases people can implement in Scripted due to its flexibility. Not to mention the number of organizations who would likely drop Pipeline and Jenkins entirely if they made a major investment in Scripted and Shared Libraries and had to walk away from 'em. I'd encourage anybody who thinks it's a good idea to come talk to me personally; I'll be happy to explain the other reasons why it's both extremely technically/architecturally difficult and a very poor idea (not going to run through it here because it's practically a novella). Ergo why I push back on trying to insert Scripted-like features such as this into Declarative – we don't want to find ourselves maintaining a new programming language. Better to make Declarative the best config language it can be, and delegate fancy stuff to a proper programming language (Groovy).  Hope that all makes sense!  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2018-04-12 Thread frther...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Francis Therien commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Sam Van Oort I thought I had read somehwhere that the roadmap was for scripted to eventually be deprecated, and that declarative would replace it. In any case, I second Liam's point that it would be interesting to see documents explaining this vision. It would help, at the very least,  people to make long term decisions for their CI architecture around Jenkins.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2018-04-12 Thread svano...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sam Van Oort commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Liam Newman FWIW I consider this the bright red line that says "no you need to be using Scripted for this." This feature would convert Declarative into a more full programming language as opposed to a simple, declarative Pipeline description.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2018-04-12 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Liam Newman - in this case, it's more that it was never something that fit into Declarative's model, and I've decided that it's time to just say yeah, it ain't happening, and move on.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2018-04-12 Thread bitwise...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Liam Newman edited a comment on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 [~abayer] Could you point to the direction we do want to go?  Is there public document(s) somewhere talking about this?     Do we need JEPs to talk about these design choices?   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2018-04-12 Thread bitwise...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Liam Newman edited a comment on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 [~abayer] Could you point to the direction we do want to go?  Is there  public  document (s)  somewhere talking about this?        
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2018-04-12 Thread bitwise...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Liam Newman commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Andrew Bayer Could you point to the direction we do want to go?  Is there document somewhere talking about this?     
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2018-04-12 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer resolved as Won't Fix  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 So, sorry to say this, but this isn't going to happen. It's not the direction we want to go with Declarative.  
 

  
 
 
 
 

 
 Jenkins /  JENKINS-41335  
 
 
  Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
Change By: 
 Andrew Bayer  
 
 
Status: 
 Open Resolved  
 
 
Resolution: 
 Won't Fix  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 

[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread rpoc...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Robby Pocase edited a comment on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 [~bitwiseman] I  could definitely accomplish this by shovelling shelved state between library methods, but its not very clean. I  use this pattern a lot for dynamically defining parallel steps between stages.  My primary usage of def is a stop gap between parallel/inner stage improvements. Library methods could likely handle this. I think some combination of JENKINS-41334 and comments from JENKINS-39932 makes this a lot better, but neither satisfy instances where what should be defined isn't known until run time (or even after scm checkout).  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread rpoc...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Robby Pocase commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Liam Newman I could definitely accomplish this by shovelling shelved state between library methods, but its not very clean. I use this pattern a lot for dynamically defining parallel steps between stages.  I think some combination of JENKINS-41334 and comments from JENKINS-39932 makes this a lot better, but neither satisfy instances where what should be defined isn't known until run time (or even after scm checkout).  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread pw...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Patrick Wolf commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 I think JENKINS-41396 solves a more concrete problem. I was thinking about helper functions and @Non-CPS functions during the JAM this morning. It is possible to write helper functions outside of pipeline block (and I have done so for some examples) but that means it can't be opened in the editor. This would allow the same thing to be done within the pipeline block and be supported in the editor. I agree with Liam Newman that sometimes you need a helper function inline in your Pipeline. Throwing everything out and converting the entire Pipeline to Scripted Pipeline isn't a good solution. I see no reason why 99% of use cases can't be solved in Declarative for users that want to use Declarative as the primary structure with some Scripted pieces. If people want to use only Scripted Pipeline because they prefer imperative to declarative programming that is fine but we should not force users to use only Scripted just because a use case isn't fully supported yet.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread bitwise...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Liam Newman commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 R. Tyler Croy Yes, that. That is want See JENKINS-41396 is about. Jason DavisRobby Pocase Would method definitions be enough, do you think?   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread ty...@monkeypox.org (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 R. Tyler Croy commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 The primary use-case that Liam Newman points out here, as I understand it, is not to add a bunch of scripting and variable silliness into a Declarative Jenkinsfile. But rather, there's no "middle-ground" between Declarative right now and Shared Libraries. Some of the folks at Mozilla have used the "loophole" which currently exists, and should be closed, to experiment with shared library ideas inside the Jenkinsfile. I think a methods directive would be helpful to bridge the gap betwixt a puritanical Declarative Pipeline and what should ultimately live in a Shared Library.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread rpoc...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Robby Pocase commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 What Liam Newman Jason Davis said. The conveniences of declarative make dropping into script from time to time fine. There will always be a need programmatic logic. Direct access in declarative would be huge for maintainability.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread jda...@ipswitch.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jason Davis commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 I agree with Liam Newman (I think ). My two cents, Declarative pipelining makes a ton of sense and it feels like a more natural model than Scripted pipelining. In declarative land, though, to get the job done, I still end up needing if-then logic, to assign variables (as per this JIRA issue), using shared functions in groovy scripts – all those things need to be wrapped with script {. Really unifying the two methods back into one official "way" to pipeline, would be great for pipeline development. It'll reduce the maintenance burden on Jenkins jobs down the road too.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread bitwise...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Liam Newman commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Jesse Glick > IMO if you are going to rely so heavily on script anyway, dispense with pipeline-model-definition and just write your script directly. I'm actually finding that Declarative combined with some helpers is really great. The overall pipeline flow goes in the Declarative, and the gritty complex logic goes in the helper methods/Steps.   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread jgl...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jesse Glick commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 I think they are both a bad idea, but this is a worse one.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Jesse Glick Ok, putting aside the variables - thoughts on functions? i.e., JENKINS-41396, which I folded into this.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread jgl...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jesse Glick commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 

I have several use cases where I may operate on a list or map on different stages of a pipeline. This variable may not be known ahead of time
 IMO if you are going to rely so heavily on script anyway, dispense with pipeline-model-definition and just write your script directly. 

his would make the use of Artifactory much simpler.
 The current plugin relies heavily on a DSL, against my advice which is to stick to plain old Step implementations using vanilla structs (or, better yet, wrappers which set the bare minimum environment necessary for non-Jenkins-specific shell/batch scripts to run). Workable in scripted Pipeline but I think it would need to be reconceptualized to be useful in Declarative. 

take the source text for define's block and pass it to the library step with a new LibraryRetriever that can output a file containing a given string
 Uh, or call evaluate?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are 

[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread svano...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Sam Van Oort commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Robby Pocase If I understand your request correctly, what you are describing is better handled by functional and imperative features in vanilla AKA "scripted" pipeline. It's breaking from the declarative model because of the potential for side effects with variable declarations and shared state.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 Hrm - realizing that this would end up in something like vars/foo.groovy, but then the methods and variables could only be accessed like foo.someVar or foo.someMethod() which wouldn't pass validation.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-41335  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
 So the way I can see to do this currently is to first have a library step added to Pipeline (i.e., JENKINS-39450). We need that for JENKINS-38110 anyway. With that step, we can add to the Binding at runtime, so we could have something like this: 

 

define {
  def foo = "bar"

  def someMethod() {
 return "Hello"
  }
}
 

 ...and then take the source text for define's block and pass it to the library step with a new LibraryRetriever that can output a file containing a given string rather than fetching from an SCM source as the existing retrievers do. Then we should, if I'm understanding correctly, get the variables and methods available from then on in the execution. Jesse Glick - does that sound right?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-41335  
 
 
  Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
Change By: 
 Andrew Bayer  
 
 
Priority: 
 Minor Critical  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41335) Allow variables and functions to be defined within pipeline to be used in any stage

2017-02-15 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-41335  
 
 
  Allow variables and functions to be defined within pipeline to be used in any stage   
 

  
 
 
 
 

 
Change By: 
 Andrew Bayer  
 
 
Summary: 
 Allow  variable  variables and functions  to be defined within pipeline to be used in any stage  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

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

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.