解决方法:
pipeline {
agent any
stages {
stage("Stage #1") {
steps {
sh 'ls'
githubNotify gitApiUrl: 'https://github.mycompany.com/api/v3', context: 'something test', description: 'This commit is being built', status: 'PENDING'
}
}
}
post {
success {
githubNotify gitApiUrl: 'https://github.mycompany.com/api/v3', context: 'something test', description: 'It works', status: 'SUCCESS'
}
failure {
githubNotify gitApiUrl: 'https://github.mycompany.com/api/v3', context: 'something test', description: 'This commit cannot be built', status: 'FAILED'
}
}
}
使用的插件:
https://github.com/jenkinsci/pipeline-githubnotify-step-plugin