Need a replacement for setUpEnvironment that can be used in Pipeline jobs
65 views
Skip to first unread message
Owen B. Mehegan
unread,
Apr 27, 2016, 8:19:07 PM4/27/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jenkins Developers
I help maintain the Jenkins GitLab plugin, and a recent major refactor (by someone else) broke our rudimentary Pipeline job type support. We have clawed our way back to partial support now, where I can get the plugin to trigger a Pipeline job, but we're stuck on the fact that none of the necessary parameters for the build are set. Looking at our code, I think the problem is that we use setUpEnvironment() for that, which I understand doesn't make sense in Pipeline. I'm not sure where we should go from here. There is a more complete explanation of my findings, with links to the relevant code, here: https://github.com/jenkinsci/gitlab-plugin/issues/271#issuecomment-215270683
Gavin Mogan
unread,
Apr 27, 2016, 10:48:37 PM4/27/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
This produces sauce {} block (due to takesImplicitBlockArgument) which makes a new context with new environment variables.
Antonio Muñiz
unread,
Apr 28, 2016, 4:54:14 AM4/28/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jenkin...@googlegroups.com
Perhaps you can switch `GitLabEnvironmentRunListener` to extend
`EnvironmentContributor` instead of `RunListener`, so any injected
environment variable will be available in a Pipeline as a groovy
variable.
--
Antonio Muñiz
Software Engineer
CloudBees, Inc.
Jesse Glick
unread,
Apr 28, 2016, 9:40:59 AM4/28/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jenkins Dev
On Thu, Apr 28, 2016 at 4:53 AM, Antonio Muñiz <amu...@cloudbees.com> wrote:
> any injected
> environment variable will be available in a Pipeline as a groovy
> variable.
Well, no, they will be available using `env.PROP` syntax, or of course
as environment variables for external processes you launch.
JENKINS-29952 proposes a unification.