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

Slave environment variables are not used during Git Polling

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Background;
      My windows %HOME% directory is on a network share. git is using an ssh key from this folder to locate the server. Running a hudson slave logged in as the same user doesn't have access this directory so requires a custom environment variable to specify a different folder.
      Setting a slave specific HOME environment variable works fine for running the build, but this variable is not used when polling for changes.

        Attachments

          Activity

          Hide
          complete_looney complete_looney added a comment -

          No, it's not resolved in 1.1. The behaviour has changed, but is not correct.

          Show
          complete_looney complete_looney added a comment - No, it's not resolved in 1.1. The behaviour has changed, but is not correct.
          Hide
          mitchellh Mitchell Hashimoto added a comment -

          Just want to note that this is not fixed currently with 1.1 and around 8 months later.

          This is also important if you're specifying environmental variables such as GIT_SSH to point to a special SSH wrapper. The clone works fine but polling doesn't pick up this environmental variable so it can never tell if the repository changed.

          Show
          mitchellh Mitchell Hashimoto added a comment - Just want to note that this is not fixed currently with 1.1 and around 8 months later. This is also important if you're specifying environmental variables such as GIT_SSH to point to a special SSH wrapper. The clone works fine but polling doesn't pick up this environmental variable so it can never tell if the repository changed.
          Hide
          christophlinder Christoph Linder added a comment -

          Also: setting the tool location on the slave via environment variables is not considered during polling.

          Steps to reproduce using Jenking Git Plugin 1.3.0 on Jenkins 1.510:
          Set environment variable on master:
          PATH_TO_TOOLS=c:\somewhere\tools

          On the Slave:
          PATH_TO_TOOLS=d:\elsewhere\tools
          Tool-Location for default git installation: ${PATH_TO_TOOLS}/git/git.exe

          During polling, jenkins always tries to execute git.exe in c:\somewhere\tools, although it is run on the slave

          Show
          christophlinder Christoph Linder added a comment - Also: setting the tool location on the slave via environment variables is not considered during polling. Steps to reproduce using Jenking Git Plugin 1.3.0 on Jenkins 1.510: Set environment variable on master: PATH_TO_TOOLS=c:\somewhere\tools On the Slave: PATH_TO_TOOLS=d:\elsewhere\tools Tool-Location for default git installation: ${PATH_TO_TOOLS}/git/git.exe During polling, jenkins always tries to execute git.exe in c:\somewhere\tools, although it is run on the slave
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          src/main/java/hudson/plugins/git/GitSCM.java
          src/test/java/hudson/plugins/git/GitSCMTest.java
          http://jenkins-ci.org/commit/git-plugin/c5b127f98ebc652eead68b39aa7f1c93094cbcc4
          Log:
          [FIXED JENKINS-7411]

          Environment variables are in fact not used at all during expansions.
          This commit fixes that. As discussed in the ticket, and as done
          elsewhere, the standard convention is to use previous build's
          environment to expand polling.

          Also see JENKINS-19042

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: src/main/java/hudson/plugins/git/GitSCM.java src/test/java/hudson/plugins/git/GitSCMTest.java http://jenkins-ci.org/commit/git-plugin/c5b127f98ebc652eead68b39aa7f1c93094cbcc4 Log: [FIXED JENKINS-7411] Environment variables are in fact not used at all during expansions. This commit fixes that. As discussed in the ticket, and as done elsewhere, the standard convention is to use previous build's environment to expand polling. Also see JENKINS-19042
          Hide
          markewaite Mark Waite added a comment -

          Closing the issue since the commit which fixed it was submitted over 6 months ago.

          Show
          markewaite Mark Waite added a comment - Closing the issue since the commit which fixed it was submitted over 6 months ago.

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              complete_looney complete_looney
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: