[JIRA] (JENKINS-50622) when condition not correctly discovering branch
Title: Message Title Liam Newman closed an issue as Not A Defect Bulk closing resolved issues. Jenkins / JENKINS-50622 when condition not correctly discovering branch 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.189696.1523007077000.16033.1571801047234%40Atlassian.JIRA.
[JIRA] (JENKINS-50622) when condition not correctly discovering branch
Title: Message Title Andrew Bayer commented on JENKINS-50622 Re: when condition not correctly discovering branch Dominik Bartholdi - Oh, definitely...which is why it is standardized with multibranch and env.BRANCH. Note that if you're using git, env.BRANCH_NAME will also still be available in a multibranch job, so you can use, say, when { _expression_ { return env.BRANCH_NAME == "master" } } whether you're in a "Pipeline script from SCM" or multibranch. 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-50622) when condition not correctly discovering branch
Title: Message Title Dominik Bartholdi commented on JENKINS-50622 Re: when condition not correctly discovering branch OK, my bad - thanks for the explanation! ...but should this not be aligned somehow? I think it just does not make much sense to have different names in different job types... 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-50622) when condition not correctly discovering branch
Title: Message Title Andrew Bayer resolved as Not A Defect Yeah, the branch when condition actually only works for multibranch - each SCM may have different environment variables for representing the branch, so we can't know what variable to check unless you're using multibranch, in which case we've got the env.BRANCH variable to look at. Jenkins / JENKINS-50622 when condition not correctly discovering branch Change By: Andrew Bayer Status: Open Resolved Resolution: Not A Defect Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are
[JIRA] (JENKINS-50622) when condition not correctly discovering branch
Title: Message Title Dominik Bartholdi commented on JENKINS-50622 Re: when condition not correctly discovering branch btw. this stage: stage('prepare yoo') { steps { echo "on ${env.BRANCH_NAME}" } } does print 'on null' - I guess this is the root problem, but I have no idea why this is the case... 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-50622) when condition not correctly discovering branch
Title: Message Title Dominik Bartholdi created an issue Jenkins / JENKINS-50622 when condition not correctly discovering branch Issue Type: Bug Assignee: Andrew Bayer Components: pipeline-model-definition-plugin Created: 2018-04-06 09:31 Environment: Pipeline Model Definition Plugin: 1.2.2 Priority: Critical Reporter: Dominik Bartholdi I created a new pipeline job and defined "Pipeline script from SCM" using Git: repo Url: g...@bitbucket.org:yooture/xxx.git branch specifier: */master Repository browser: (auto) Additional Behaviours: none Script Path: Jenkinsfile Lightweight checkout: on In have the following simele pipeline: pipeline { agent { label 'lxc-fedora25' } tools { maven 'MVN_352' jdk "Oracle JDK 1.8 (latest)" } stages { stage('build Snapshot') { when { not { branch 'master' } } steps { sh 'mvn clean install -Dmaven.test.failure.ignore' } } stage('Build Release') { when { branch 'master' } steps { sh "mvn clean deploy" } } } }
[JIRA] (JENKINS-50622) when condition not correctly discovering branch
Title: Message Title Dominik Bartholdi updated an issue Jenkins / JENKINS-50622 when condition not correctly discovering branch Change By: Dominik Bartholdi I created a new pipeline job and defined "Pipeline script from SCM" using Git: * repo Url: g...@bitbucket.org:yooture/xxx.git * branch specifier: */master * Repository browser: (auto) * Additional Behaviours: none * Script Path: Jenkinsfile * Lightweight checkout: onIn have the following simele simple pipeline: {code:java}pipeline { agent { label 'lxc-fedora25' } tools { maven 'MVN_352' jdk "Oracle JDK 1.8 (latest)" } stages { stage('build Snapshot') { when { not { branch 'master' } } steps { sh 'mvn clean install -Dmaven.test.failure.ignore' } } stage('Build Release') { when { branch 'master' } steps { sh "mvn clean deploy" } } }}{code} even though the branch specifier is specified as "*/master", "build Snapshot" stage is always executed :( Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)