Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45223

Pipeline jobs do not have access to env.BRANCH

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • gitlab-plugin, pipeline
    • None
    • Jenkins ver. 2.63
      GitLab plugin 1.4.5

      So, I've already had to abandon multibranch pipelines because they don't get the gitlab variables that I need for my build. Now, I'm working on a regular pipeline and it doesn't have access to the global BRANCH variable.

      So, I can't do pleasant stage conditions like this

      when {
          branch 'master'
      }
      

      I have to write gnarlier conditions

      when {
          environment name: 'gitlabBranch', value: 'master'
      }
      

            owenmehegan Owen Mehegan
            anthonymastrean Anthony Mastrean
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: