7 Star 8 Fork 5

Jenkins中文社区 / wechat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Jenkinsfile 868 Bytes
一键复制 编辑 原始数据 按行查看 历史
yJunS 提交于 2020-02-28 19:14 . 添加jenkinsfile逻辑
pipeline {
agent {
label 'linux'
}
options {
disableConcurrentBuilds()
quietPeriod 30
}
stages{
stage("Notify"){
when {
branch 'master'
}
steps{
try{
postBuild()
}catch{
retry(3){
postBuild()
}
}
}
}
}
}
def postBuild() {
withCredentials([string(credentialsId: '0404af2d-8738-402e-922d-5acee65d3059', variable: 'TOKEN')]) {
sh '''
curl -X POST -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${TOKEN}" -i "https://api.github.com/repos/jenkins-zh/jenkins-zh/dispatches" -d '{"event_type":"repository_dispatch"}'
'''
}
}
1
https://gitee.com/jenkins-zh/wechat.git
git@gitee.com:jenkins-zh/wechat.git
jenkins-zh
wechat
wechat
master

搜索帮助