How can I access the last built revision according to jenkins?

后端 未结 5 1300
一整个雨季
一整个雨季 2021-02-06 05:50

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

5条回答
  •  终归单人心
    2021-02-06 06:23

    The current build-number is provided as the Jenkins-variable BUILD_NUMBER

    • In Unix it is set for you as ${BUILD_NUMBER}
    • In Windows it is available as %BUILD_NUMBER%

    The complete list of variables is available on your Jenkins server, at:
    http://[your-jenkins-server]/env-vars.html

提交回复
热议问题