How to get build time stamp from Jenkins build variables?

前端 未结 10 929
余生分开走
余生分开走 2020-12-24 11:25

How can I get build time stamp of the latest build from Jenkins? I want to insert this value in the Email subject in post build actions.

10条回答
  •  囚心锁ツ
    2020-12-24 12:08

    NOTE: This changed in Jenkins 1.597, Please see here for more info regarding the migration

    You should be able to view all the global environment variables that are available during the build by navigating to https:///env-vars.html.

    Replace https:/// with the URL you use to get to Jenkins webpage (for example, it could be http://localhost:8080/env-vars.html).

    One of the environment variables is :

    BUILD_ID
        The current build id, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)
    

    If you use jenkins editable email notification, you should be able to use ${ENV, var="BUILD_ID"} in the subject line of your email.

提交回复
热议问题