def riqi=''
import java.text.SimpleDateFormat
pipeline {
agent any
environment{
name='親愛的測試員~'
date="\$(date +%Y%m%d%H)"
}
stage('定義日期'){
steps{
script{
def dateFormat = new SimpleDateFormat("yyyyMMddHHmm")
def date = new Date()
riqi=dateFormat.format(date)
}
}
}
post {
success {
dingTalk accessToken:'釘釘webwook路徑',
jenkinsUrl:'jenkins路徑/',
message:'打包成功,獲取地址:http://xxx/test/xxx_'+"${params.xxx_version}"+'_'+"${riqi}",
notifyPeople:'所有人'
}
failure {
dingTalk accessToken:'釘釘webwook路徑',
imageUrl:'圖片地址',
jenkinsUrl:'jenkins路徑/',
message:'打包失敗',
notifyPeople:'wuzz'
}
}
}