SVN_REVISION environment variable not available to promote build shell command

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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.

            Assignee:
            Unassigned
            Reporter:
            Robert Elliot
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: