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

SVN_REVISION environment variable not available to promote build shell command

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • promoted-builds-plugin
    • None
    • Centos, Java 6, Jenkins 1.410

      When adding a shell action to a promotion process on a job that is using subversion source control the SVN_REVISION environment variable is not provided. The BUILD_NUMBER environment variable is there and correct, so we can work around it as so:

      export SVN_REVISION=`wget -qO- http://<host>/job/spike-application/${BUILD_NUMBER}/api/xml?tree=changeSet[revisions[revision]] | grep -o "[0-9]\+"`
      echo PROMOTED ${SVN_REVISION} from unstable to stable

      However, that's obviously horrible and given the BUILD_NUMBER is available it should be possible to retrieve the SVN_REVISION without an HTTP request.

            Unassigned Unassigned
            mahoney Robert Elliot
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: