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

Environment variables are not expanded in tag names when publishing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin

      I'm using the Git Publisher post-build action to try and push a tag that was created during the build.

      The tag name is placed into an environment variable via the line:

      export BUILD_VERSION=`node -e "console.log(require('./package.json').version);"`
      

      The Git Publisher is then configured to push the Tag $BUILD_VERSION

      Rather than push it, I get an error in my build console:

         > git tag -l $BUILD_VERSION # timeout=10
      ERROR: Publisher hudson.plugins.git.GitPublisher aborted due to exception
      hudson.AbortException: Tag $BUILD_VERSION does not exist and Create Tag is not specified, so failing.
      	at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:287)
      	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.model.Build$BuildExecution.post2(Build.java:183)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
      	at hudson.model.Run.execute(Run.java:1784)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:89)
      	at hudson.model.Executor.run(Executor.java:240)
      

            Unassigned Unassigned
            dancrumb Dan Rumney
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: