Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50785

when stage and input stage both is not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • pipeline
    • None

      pipeline {
      agent any
      environment {

      buildUser = '';
      }

      tools {

      maven 'M3'
      }
      stages {

      stage('build user') {
      steps {
      wrap([$class: 'BuildUser']) {
      sh 'echo "${BUILD_USER}"'
      script {
      buildUser = "${BUILD_USER}";

      echo env.BUILD_USER_ID
      try {
      if(env.BUILD_USER_ID != 'admin'){
      error '发布stop'
      }
      }catch(e) {

      }
      }
      }

      }
      }

      stage('bate') {

      when {
      expression {
      return false
      }
      }

      input {
      message "deploy to pro?"
      ok "Yes"
      submitter "admin"
      parameters {
      string(name: 'isdeploy', defaultValue: '0', description: 'deploy')
      }
      }

      steps {

      script {
      sh 'echo 1111 '

      }
      }
      }
      }
      }

            Unassigned Unassigned
            lee xian xjr
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: