jenkins構建結果通知釘釘羣

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'
			  }
			}
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章