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

need to support or reject non string based environment variables.

XMLWordPrintable

      I created a declarative pipeline with the following syntax and it did not behave as I expected.

      either the syntax should be rejected or it should work - otherwise surprises ensue...

      pipeline {
          agent none
          environment {
              POM_ONLY = false // (also change to true to check)
          }
          stages {
              stage("test") {
                  when {
                    expression {
                      POM_ONLY == false
                    }
                  }
                  steps {
                      echo "pom only is false!"
                  }
              }
              stage("notest") {
                  when {
                    expression {
                      POM_ONLY != false
                    }
                  }
                  steps {
                      echo "pom only is true!"
                  }
              }
          }
      }
      

            abayer Andrew Bayer
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: