pipeline/freestylejob cannot get empty param value

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

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor
    • Component/s: core
    • Environment:
      ubuntu
      jenkins 2.249.3

      jdk8

      There are 2 questions :

      1。 pipeline/freestylejob cannot get empty param value。
      2。 pipeline under docker agent can  get empty param value。
      

      I define the pipelie with parameter like below

      parameters {
           string(name: 'ANDROID_PLATFORM', defaultValue: '')
      }
      

      in stage i try to print this parameter 'ANDROID_PLATFORM', like below

      stage("0.clean ws") {
      steps {
        sh '''#!/bin/bash
      env
      '''
      }
      }
      
      
      

      start this pipeline with empty string ANDROID_PLATFORM, the env command not print this value.
      in python code i try to get ANDROID_PLATFORM like this

        os.environ.get("ANDROID_PLATFORM")

      but this return None.I want this return "", an empty string value。

      workaround in python maybe work well like this:

        os.environ.get("ANDROID_PLATFORM", "")

            Assignee:
            Unassigned
            Reporter:
            bright.ma
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: