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

Cannot use ENV variable for repository url in Git Publisher

      If you've a variable as the Repository URL, e.g. ${GIT_REPO}

      {GIT_REPO}

      doesn't get replaced in git publisher - it will do

      hudson.plugins.git.GitException: Command "git push ${GIT_REPO} 1.1.761 -f" returned status code 128:
      stdout:

          [JENKINS-27508] Cannot use ENV variable for repository url in Git Publisher

          Peter lai created issue -

          Deniz Bahadir added a comment -

          There are also other form-fields where successfull variable-substitution would make sense.

          For example I stumbled about the missing substitution-feature for the Path field of the Sparse Checkout path option.
          However, variable-substitution works e.g. for the Local subdirectory for repo field of the Check out to a sub-directory option.

          I would suggest this plugin supports (environment) variable-substitution in all form-fields.

          Deniz Bahadir added a comment - There are also other form-fields where successfull variable-substitution would make sense. For example I stumbled about the missing substitution-feature for the Path field of the Sparse Checkout path option. However, variable-substitution works e.g. for the Local subdirectory for repo field of the Check out to a sub-directory option. I would suggest this plugin supports (environment) variable-substitution in all form-fields.
          Aaron D. Marasco made changes -
          Link New: This issue is related to JENKINS-23477 [ JENKINS-23477 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 161717 ] New: JNJira + In-Review [ 180808 ]
          Michael Fowler made changes -
          Link New: This issue is related to JENKINS-30287 [ JENKINS-30287 ]

          Monkey Little added a comment - - edited

          As of June 30, 2017, repo path and branch spec can use variables and they are expanded.  But the sparse checkout path is still not.

          Monkey Little added a comment - - edited As of June 30, 2017, repo path and branch spec can use variables and they are expanded.  But the sparse checkout path is still not.
          Monkey Little made changes -
          Priority Original: Minor [ 4 ] New: Critical [ 2 ]
          Mark Waite made changes -
          Link New: This issue is related to JENKINS-49834 [ JENKINS-49834 ]

          believe I see a related issue when used with a pipeline. In this case I have a parameterized build, I use the parameter for the branch name but it doesn't get expanded.  If I do the same think in a freestyle job it works.

          Daniel Carreira added a comment - believe I see a related issue when used with a pipeline. In this case I have a parameterized build, I use the parameter for the branch name but it doesn't get expanded.  If I do the same think in a freestyle job it works.

          dcarreira your problem sounds like the groovy didn't properly interpret the string; is it double quoted?

          Aaron D. Marasco added a comment - dcarreira your problem sounds like the groovy didn't properly interpret the string; is it double quoted?

            yashj21 Yash Amrut Jain
            peterlai Peter lai
            Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: