Pipeline environment 'constant' fails when in lowercase or in collision with Configuration environment 'constant'

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      'lower' sometime is not printed:

      #!/usr/bin/env groovy
      
      def getMyValue() { return 'MY_VALUE' }
      def getJobUrl() { return env['JOB_URL'] ?: env['FOO'] }
      
      pipeline {
          agent { node { label 'xwiki' } }
          options { skipDefaultCheckout() }
          environment {
              UPPER = 'UPPER'
              lower = 'lower'
                                    
              MY_VALUE = getMyValue()
              my_value = getMyValue()
                                     
              MY_JOB = getJobUrl()
              my_job = getJobUrl()
          }
          stages {
              stage('Envs UPPER and lower') {
                  steps {
                      sh("echo U \$UPPER")
                      sh("echo l \$lower")                
                      
                      sh 'echo U $UPPER'
                      sh 'echo l $lower'
      
                      sh("echo M \$MY_VALUE")
                      sh("echo m \$my_value") 
                     
                      sh 'echo M $MY_VALUE'
                      sh 'echo m $my_value' 
                      
                      sh("echo M \$MY_JOB")
                      sh("echo m \$my_job")
                     
                      sh 'echo M $MY_JOB'
                      sh 'echo m $my_job'
                  }
              }
          }
      }
      

            Assignee:
            Unassigned
            Reporter:
            Basile Chandesris
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: