[JIRA] [workflow-plugin] (JENKINS-32400) Import shared Groovy code

2016-02-19 Thread monitor...@gmail.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Taylor Jones commented on  JENKINS-32400 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Import shared Groovy code  
 
 
 
 
 
 
 
 
 
 
Any update on this? The current import method is still crzy annoying. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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] [workflow-plugin] (JENKINS-32400) Import shared Groovy code

2016-01-11 Thread monitor...@gmail.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Taylor Jones created an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Jenkins /  JENKINS-32400 
 
 
 
  Import shared Groovy code  
 
 
 
 
 
 
 
 
 

Issue Type:
 
  Improvement 
 
 
 

Assignee:
 
 Jesse Glick 
 
 
 

Components:
 

 workflow-plugin 
 
 
 

Created:
 

 11/Jan/16 10:11 PM 
 
 
 

Environment:
 

 Jenkins: 1.625.3  Workflow plugin: 1.11 
 
 
 

Priority:
 
  Minor 
 
 
 

Reporter:
 
 Taylor Jones 
 
 
 
 
 
 
 
 
 
 
It should be possible to import shared Groovy code from the SCM source in a Workflow job. For instance, if my workflow script (flow.groovy) needs to access variables from another script (constants.groovy) and they are both in the SCM repo that the Workflow job checked out, it should be simple to do. It's not and currently the unabashedly terrible workaround is to do this: 

 

def constants

stage('Import dependencies')
node{  
  git(url: 'ssh://g...@mygitserver.com:7999/ex/workflow.git', credentialsId: '60cda0cc-f13d-448c-9947-28b926a20628')
  constants = load('constants.groovy')
}
 

 
This works, but the fact that another node has to be spun up and another git checkout command is required is awful. It should be pretty straightfoward to have Jenkins simply load one of these files. Something like this: