正文

Jenkin pipeline 增加 等待 輸入 功能

(2019-04-23 13:18:55) 下一個

pipeline {
  agent none
  stages {
    stage('Build') {
      
      steps {
        echo " build1 "
      }
    }
    stage('check if management signed off ? ') {
      agent none
      steps {
        script {
          env.GO_or_NO_GO = input message: 'User input required',
              parameters: [choice(name: 'GO or no go today ', choices: 'YESnNO', description: 'Choose "yes" if we get signed off from manager')]
        }
      }
    }
    stage('after president say go ') {
      agent none
      when {
        environment name: 'GO_or_NO_GO', value: 'YES'
      }
      steps {
        echo "last step: begin deploy to production "
      }
    }
  }
}

[ 打印 ]
閱讀 ()評論 (0)
評論
目前還沒有任何評論
登錄後才可評論.