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

Pipeline jobs do not have access to env.BRANCH

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Duplicate
    • gitlab-plugin, pipeline
    • None
    • Jenkins ver. 2.63
      GitLab plugin 1.4.5

    Description

      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'
      }
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: