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

Pipelines not correctly picking up global environment variables

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • pipeline
    • None

      We have configured several environment variables on the global level, which should be picked up and have the right values on all agents. In the freestyle jobs, everything works as expected. We are now slowly converting our jobs to pipelines, but some env-vars are not picked up correctly.

      For instance, we have an env-var 'ANDROID_SDK_ROOT', which is pointing to '$HOME/android/sdk'. With freestyle-jobs, this variable turns into '/home/jenkins/android/sdk' on most of my Linux-based agents or '/Users/jenkins/android/sdk' on the Mac-agents.

      When we evaluate '$ANDROID_SDK_ROOT' in a pipeline (eg with sh-step 'env | sort'), it simply returns the configured String '$HOME/android/sdk', which makes this env-var unusable in pipelines.

      Since we have multiple OSes, and sometimes different users on the machines as well, we can't change the value to a hard path. However, since this has worked correctly in non-pipeline jobs, I assume this is a bug in the pipelines?

            Unassigned Unassigned
            malice00 Roland Asmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: