Jenkins使用时间插件Date Parameter
1、安装插件Date Parameter
- 首先在Jenkins的插件管理中安装Date Parameter插件:Manage Jenkins —> Plugin Manager —> Avaiable中搜索Date Parameter。
- 安装完成后重启jenkins;
2、使用参数
- 添加参数
定义参数
语法
You can create a ‘default value’ in one of two forms.
- Java LocalDate or LocalDateTime code style
LocalDate.now();
LocalDate.now().plusDays(1);
LocalDate.now().plusDays(1).plusYears(2);
LocalDate.now().minusDays(5).minusMonths(3).minusYears(2);
LocalDateTime.now()
LocalDateTime.now().minusHours(5).plusMinutes(10).minusSeconds(20);
LocalDateTime.now().minusDays(5).plusYears(5).plusSeconds(50);- LocalDate String (This case should match the format of ‘dateFormat’)
20170501
2017-05-01
- 使用 ${ENV,var=“dat”}在邮件里可以直接通过这个标签获取到我们在jenkins界面上传入的参数
3 举例
- 定义两个时间变量currentTime和mM
- shell中只用变量
- 邮件中使用变量
还没有评论,来说两句吧...