Jenkins:Version Number进行日志文件命名(笔

2020-05-08  本文已影响0人  liuxiro

插件名称:Version Number

例如:${JOB_NAME}_${BUILD_DATE_FORMATTED, "yyyyMMdd"}_${BUILDS_TODAY}

Jenkins配置 日志文件

插件预定义版本号:

BUILD_DATE_FORMATTED

Takes the second argument and returns a java-formatted date string for the given build date. For example, ${BUILD_DATE_FORMATTED, "yyyy-MM-dd"} would return the date (and not the time) as something like 2009-10-01. The date format string must be surrounded by quotes, and any whitespace within the format string is significant.

BUILD_DAY

With no arguments, it just returns the day of the build as an integer. If there is an argument, it takes the number of characters in the argument and uses that pad the date string. For example, if it's the third of the month, ${BUILD_DAY} would return 3, ${BUILD_DAY, X} would return 3, and ${BUILD_DAY, XX} would return 03.

BUILD_WEEK

Returns the week, with the same argument convention for BUILD_DAY

BUILD_MONTH

Returns the month, with the same argument convention for BUILD_DAY

BUILD_YEAR

Returns the year, with the same argument convention for BUILD_DAY

BUILDS_TODAY

Returns the number of builds that have happened today, including this one. This resets at midnight. The argument convention is the same as for BUILD_DAY

BUILDS_THIS_WEEK

Returns the number of builds that have happened this week, including this one. This resets at the start of the week. The argument convention is the same as for BUILD_DAY

BUILDS_THIS_MONTH

Returns the number of builds that have happened this month, including this one. This resets at the first of the month. The argument convention is the same as for BUILD_DAY

BUILDS_THIS_YEAR

Returns the number of builds that have happened this year. This resets at the first of the year. The argument convention is the same as for BUILD_DAY.

BUILDS_ALL_TIME

Returns the number of builds that have happened since the project has begun. This is distinct from the hudson build number, in that it can be reset periodically (for example, when moving from 1.0.${BUILDS_ALL_TIME} to 2.0.${BUILDS_ALL_TIME}, and can be configured to start at an arbitrary number instead of the standard begin date.

MONTHS_SINCE_PROJECT_START

The number of months since the project start date. This is strictly dependent on the month of the current build and the month of the project start date; if the project was begun October 31st and the build was November 1st, then this would return 1. If the project was begin October 1st and the build was November 30th, this would also return 1. The argument convention is the same as for BUILD_DAY.

YEARS_SINCE_PROJECT_START

The number of years since the project start date. Like MONTHS_SINCE_PROJECT_START, this is dependent only on the year.

上一篇下一篇

猜你喜欢

热点阅读