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

Git Plugin env variable resolution not working in Git Publisher

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.581
      Git Plugin 2.2.6
    • Similar Issues:

      Description

      Hi,

      I'm using Git in a Jenkins process with the following URL:

      http://192.168.0.17:7990/scm/sour/${REPO_NAME}.git

      where REPO_NAME is given as a Parameter to the Job.

      The Source Code Checkout works fine, the URL can be resolved with the variable in it.
      At the end of the process I use the "Git Publisher" Post Build Action with following configuration:

      Push Only If Build Succeeded (true)
      Tag to push $TAG_NAME
      Tag message ...
      Create new tag (true)
      Target remote Name: sources_repo

      But now, the GIT URL from above can not be resolved as the variable REPO_NAME can not be resolved. The process Fails with the following exception:

      Pushing tag testapp-1.0.0-58 to repo sources_repo
      ERROR: Failed to push tag testapp-1.0.0-58 to sources_repo
      hudson.plugins.git.GitException: Invalid URL http://192.168.0.17:7990/scm/sour/${REPO_NAME}.git
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkCredentials(CliGitAPIImpl.java:2259)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1171)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:87)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$7.execute(CliGitAPIImpl.java:1492)
      at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:298)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1040)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
      at hudson.model.Run.execute(Run.java:1770)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
      at hudson.model.ResourceController.execute(ResourceController.java:89)
      at hudson.model.Executor.run(Executor.java:240)
      Build step 'Git Publisher' marked build as failure

      Maybe you could have an eye on this?

      Kind regards,

      Tobias

        Attachments

          Issue Links

            Activity

            Hide
            markewaite Mark Waite added a comment -

            Switching back to git plugin 2.2.5 is reported to resolve this issue.

            Show
            markewaite Mark Waite added a comment - Switching back to git plugin 2.2.5 is reported to resolve this issue.
            Hide
            tobias_schaber tobias schaber added a comment -

            Hi Mark,

            First: Sorry for not finding the duplicate entry. Thank you for your Response, it works. Great. You helped me over!

            Kind regards,
            Tobias

            Show
            tobias_schaber tobias schaber added a comment - Hi Mark, First: Sorry for not finding the duplicate entry. Thank you for your Response, it works. Great. You helped me over! Kind regards, Tobias

              People

              • Assignee:
                markewaite Mark Waite
                Reporter:
                tobias_schaber tobias schaber
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: