分享

Creating Environment variables in Jenkins

 bananarlily 2016-02-25
up vote 2 down vote accepted

I confirm that you can use the EnvInject plugin with a Groovy script:

enter image description here

Here is the Groovy script:

// Generate a global BUILD_ID_LONG variable with date and time
// =======================================

TimeZone.setDefault(TimeZone.getTimeZone('UTC'))
def now = new Date()
def map = [BUILD_ID_LONG: now.format("yyyyMMdd_HHmm")]
return map

Next, you can use the ${BUILD_ID_LONG} variable in your build steps.

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多