[JIRA] (JENKINS-55587) Env variables not available in pipeline options sections, outside of stages
Title: Message Title Luke Lussenden edited a comment on JENKINS-55587 Re: Env variables not available in pipeline options sections, outside of stages I use the options style lock to wrap a few stages in a large pipeline and I have the same problem. Even though the lock is deep within the pipeline, it seems the options are per-computed before the run and the ENV variables are not yet injected. For my use case - I would really like to use the `GIT_URL` provided by the multibranch pipeline project as the source of my lock. I don't mind multiple branches building at once, but there is a section they can't be in at the same time if they are on the same repo. ``` {code: groovy } stages { stage('do stuff 1'){} stage('do stuff 2'){} stage('locked set'){ stages { options \ { lock(resource: "${GIT_URL}") } stage('first action set') \ { } stage('second action set') \ { } } } stage('do final stuff'){}} {code} ``` If you have a parameterized build - I believe parameters are available to the options blocks - but not environment variables. Add Comment This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38) -- 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.196752.1547507207000.988.1583530680216%40Atlassian.JIRA.
[JIRA] (JENKINS-55587) Env variables not available in pipeline options sections, outside of stages
Title: Message Title Luke Lussenden commented on JENKINS-55587 Re: Env variables not available in pipeline options sections, outside of stages I use the options style lock to wrap a few stages in a large pipeline and I have the same problem. Even though the lock is deep within the pipeline, it seems the options are per-computed before the run and the ENV variables are not yet injected. For my use case - I would really like to use the `GIT_URL` provided by the multibranch pipeline project as the source of my lock. I don't mind multiple branches building at once, but there is a section they can't be in at the same time if they are on the same repo. ```groovy stages { stage('do stuff 1'){} stage('do stuff 2'){} stage('locked set'){ stages { options { lock(resource: "${GIT_URL}") } stage('first action set'){ } stage('second action set'){ } } } stage('do final stuff'){} } ``` If you have a parameterized build - I believe parameters are available to the options blocks - but not environment variables. Add Comment This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38) -- 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.196752.1547507207000.983.1583530560177%40Atlassian.JIRA.
[JIRA] (JENKINS-55587) Env variables not available in pipeline options sections, outside of stages
Title: Message Title Alexandre Fabra Fernandez updated an issue Jenkins / JENKINS-55587 Env variables not available in pipeline options sections, outside of stages Change By: Alexandre Fabra Fernandez Sprint: Declarative backlog 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.196752.1547507207000.10268.1575321300261%40Atlassian.JIRA.
[JIRA] (JENKINS-55587) Env variables not available in pipeline options sections, outside of stages
Title: Message Title Andrew Bayer updated an issue Jenkins / JENKINS-55587 Env variables not available in pipeline options sections, outside of stages Change By: Andrew Bayer Component/s: pipeline-model-definition-plugin Component/s: pipeline Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- 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-55587) Env variables not available in pipeline options sections, outside of stages
Title: Message Title Chad Geisler created an issue Jenkins / JENKINS-55587 Env variables not available in pipeline options sections, outside of stages Issue Type: Bug Assignee: Unassigned Components: pipeline Created: 2019-01-14 23:06 Labels: pipeline Priority: Major Reporter: Chad Geisler Environments variables such as ${env.NODE_NAME} are not available in Options {} before stages. I want to dynamically lock a node using options {} before the first stage starts and keep that node locked for the entire pipeline. I have spent hours on this everything I tried returns NULL. I know I can lock each stage individually but that won't work for me since it releases that lock at the end of each stage. options { lock (resource: "${env.NODE_NAME}") } stages { stage("stage name") { steps {. Add Comment