Near the top of my build console I see a \"Last Built Revision:\" w/ a revision #. How can I access this last built rev # in my build script? I\'m using Gradle, but I don\'t t
I do not think the git plugin exports the last built revision as an environment variable, but the information is easily available using a simple shell command like:
curl -sf "$BUILD_URL/api/xml?xpath=//lastBuiltRevision/SHA1/text()"
BUILD_URL always points to the build's own page and the rest of the information seems to be available using the xml api.