How to use post steps with Jenkins pipeline on multiple agents?

后端 未结 2 1380
花落未央
花落未央 2020-12-13 19:38

When using the Jenkins pipeline where each stage runs on a different agent, it is good practice to use agent none at the beginning:

pipeline {
          


        
2条回答
  •  自闭症患者
    2020-12-13 20:19

    wrap the step that does the mailing in a node step:

    post {
      always {
        node('awesome_node_label') {
          step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "test@test.com", sendToIndividuals: true])
        }
      }
    }
    

提交回复
热议问题