文章目录
1. 在jenkins安装插件【Qy Wechat Notification】
2. 在企业微信的群里创建机器人
3. 在jenkins配置企业微信
这里的默认Webhook地址就是步骤2企业微信机器人的Webhook地址
4. 在jenkinsfile文件里加上推送语句
pipeline {
agent any
stages{
stage('拉取代码'){
steps {
……
}
}
stage('编译构建'){
}
stage('远程部署'){
}
}
post{
success{
qyWechatNotification mentionedId: '', mentionedMobile: '', moreInfo: '', webhookUrl: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=*****************'
}
failure{
qyWechatNotification mentionedId: '', mentionedMobile: '', moreInfo: '', webhookUrl: 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=*****************'
}
}
}