jenkins重置构建历史

  1. item = Jenkins.instance.getItemByFullName("Autocheck/AG55X")
  2. //THIS WILL REMOVE ALL BUILD HISTORY
  3. item.builds.each() { build ->
  4. build.delete()
  5. }
  6. item.updateNextBuildNumber(1)

流水线语法

  1. pipeline{
  2. agent any
  3. environment{
  4. key:'value'
  5. }
  6. stages{
  7. stage('拉取git仓库代码'){
  8. steps{
  9. echo 'hello world'
  10. }
  11. }
  12. stage('拉取git仓库代码'){
  13. steps{
  14. echo 'hello world'
  15. }
  16. }
  17. stage('拉取git仓库代码'){
  18. steps{
  19. echo 'hello world'
  20. }
  21. }
  22. }
  23. }

钉钉推送

dingtalk(
robot: “jenkins-dingding”,
type: “MARKDOWN”,
title: “SUCCESS: ${JOB_NAME}”,
text: [“- 成功构建: ${JOB_NAME} \n - 版本:${tag} \n - 持续时间:${currentBuild.durationSting}” ]
)

kubernetes

k8s官网
安装