jenkins重置构建历史
item = Jenkins.instance.getItemByFullName("Autocheck/AG55X")
//THIS WILL REMOVE ALL BUILD HISTORY
item.builds.each() { build ->
build.delete()
}
item.updateNextBuildNumber(1)
流水线语法
pipeline{
agent any
environment{
key:'value'
}
stages{
stage('拉取git仓库代码'){
steps{
echo 'hello world'
}
}
stage('拉取git仓库代码'){
steps{
echo 'hello world'
}
}
stage('拉取git仓库代码'){
steps{
echo 'hello world'
}
}
}
}
钉钉推送
dingtalk(
robot: “jenkins-dingding”,
type: “MARKDOWN”,
title: “SUCCESS: ${JOB_NAME}”,
text: [“- 成功构建: ${JOB_NAME} \n - 版本:${tag} \n - 持续时间:${currentBuild.durationSting}” ]
)