启动时获取Jenkins的构建时间 [英] Getting Jenkins build time when started

查看:334
本文介绍了启动时获取Jenkins的构建时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取开始构建的时间.我知道内部版本名称和编号,但是窍门是内部版本可能尚未完成.该脚本可以在Jenkins服务器上运行,也可以是API调用.有什么办法可以做到吗?

I want to get the time when a build was started. I know the build name and number, but trick is the build may not have completed yet. The script can run on the Jenkins server or can be an API call. Any way I can accomplish that?

推荐答案

您可以安装 ZenTimestamp插件,并使用此插件添加的BUILD_TIMESTAMP变量获取时间戳.

You can install ZenTimestamp Plugin and get the time stamp using BUILD_TIMESTAMP variable added by this plugin.

注意:

  1. 您需要指定SimpleDateFormat模式(例如yyyyMMddHHmmss).
  2. 您必须激活全球财产!

这篇关于启动时获取Jenkins的构建时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆