正文

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)
评论
目前还没有任何评论
登录后才可评论.