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

want to get the previous build value in defaultValue. Don't want to hardcode value.Don't wnt to use plugin for this.

XMLWordPrintable

      want to get the previous build value in defaultValue. Don't want to hardcode value.Don't wnt to use plugin for this.

       

      ==========================================

      def Account_ID
      pipeline {
      agent any

      options

      { buildDiscarder(logRotator(numToKeepStr: '7')) }

      parameters {(
      string(defaultValue: "${Account_ID}" ,name: 'env', description: 'Enter environment.'))}

      stage('Prod Build') {
      when {
      expression{"${Account_ID}" == 'prod'}
      }
      steps {
      echo "prod"
      }}

      stage('Non-Prod Build') {
      when {
      expression{"${Account_ID}" == 'non'}
      }
      steps

      { echo "non-prod " }

      }}}

            sugonyak_ivan Ivan Sugonyak
            umairhassan98 umair
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: