以下是一个在 Jenkinsfile
中配置邮件通知的示例代码:
pipeline {
agent any
stages {
stage('Build') {
steps {
// 构建步骤
}
}
}
post {
always {
emailext body: '构建完成!',
recipientProviders: [[$class: 'DevelopersRecipientProvider']],
subject: '构建结果通知'
}
}
}