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

GIT_BRANCH not set when multiple branches are selected for build

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Windows 7
    • Similar Issues:

      Description

      When trying to identify what branch the current build are on i found that the GIT_BRANCH environment variable is not set when more then a single branch is selected to be built.

      I have seen that getSingleBranch(build) returns null when that happens GIT_BRANCH is not exposed to the build.

        Attachments

          Activity

          Hide
          squeedee Rasheed Abdul-Aziz added a comment -

          Oh and i discovered that 1.1.5 of http://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin supports Parameterized build plugin, passing the SHA o the next build.

          Show
          squeedee Rasheed Abdul-Aziz added a comment - Oh and i discovered that 1.1.5 of http://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin supports Parameterized build plugin, passing the SHA o the next build.
          Hide
          cweiske_nr Christian Weiske added a comment -

          Today with Jenkins 1.430 and Git plugin 1.1.12, I can use $GIT_BRANCH in the job's workspace setting without problems - if I use one branch only or two.

          Show
          cweiske_nr Christian Weiske added a comment - Today with Jenkins 1.430 and Git plugin 1.1.12, I can use $GIT_BRANCH in the job's workspace setting without problems - if I use one branch only or two.
          Hide
          apaku Andreas Pakulat added a comment -

          I don't think thats true, its not fixed, the plugin just lost its ability to build multiple branches. At least it does not do that for me anymore. I've filed JENKINS-11337 for that now.

          Show
          apaku Andreas Pakulat added a comment - I don't think thats true, its not fixed, the plugin just lost its ability to build multiple branches. At least it does not do that for me anymore. I've filed JENKINS-11337 for that now.
          Hide
          cebe Carsten Brandt added a comment -

          Had it working with 1.454, updated to 1.457 and it now fails...
          Whats the problem with setting GIT_BRANCH env variable to the branch currently beeing built while build step (exec shell, etc...)

          Show
          cebe Carsten Brandt added a comment - Had it working with 1.454, updated to 1.457 and it now fails... Whats the problem with setting GIT_BRANCH env variable to the branch currently beeing built while build step (exec shell, etc...)
          Hide
          markewaite Mark Waite added a comment -

          Considering the age of this issue, it won't be fixed. Use Jenkins Pipeline or create separate jobs for each branch

          Show
          markewaite Mark Waite added a comment - Considering the age of this issue, it won't be fixed. Use Jenkins Pipeline or create separate jobs for each branch

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jadaks31 jadaks31
            Votes:
            7 Vote for this issue
            Watchers:
            11 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: