SHOWcode

2021年1月6日 星期三

Jenkins-mail

參考:http://www.linuxea.com/1767.html 前置作業略過~有空再補 Mailer Plugin
post {
        success {
            emailext (
                subject: "${env.JOB_NAME} [${env.BUILD_NUMBER}] 更新正常",
                body: """
                內容:
                SUCCESSFUL: Job ${env.JOB_NAME} [${env.BUILD_NUMBER}]
                狀態:${env.JOB_NAME} jenkins 更新執行正常 
                URL :${env.BUILD_URL}
                項目 :${env.JOB_NAME} 
                項目更新进度:${env.BUILD_NUMBER}
                """,
                to: USER_MAIL,
                recipientProviders: [[$class: 'DevelopersRecipientProvider']]
                )
                }   
        failure {
            emailext (
                subject: "${env.JOB_NAME} [${env.BUILD_NUMBER}] 更新失敗",
                body: """
                內容:
                FAILED: Job ${env.JOB_NAME} [${env.BUILD_NUMBER}]             
                狀態:${env.JOB_NAME} jenkins 執行失敗 
                URL :${env.BUILD_URL}
                項目 :${env.JOB_NAME} 
                項目更新進度:${env.BUILD_NUMBER}
                ERROR_CODE: ${ERROR_CODE} 
                """,
                to: USER_MAIL,
                recipientProviders: [[$class: 'DevelopersRecipientProvider']]
                )
                }
    }

沒有留言:

張貼留言

Jenkins-mail

參考:http://www.linuxea.com/1767.html 前置作業略過~有空再補 Mailer Plugin post { success { emailext ( subject: &...