Kartik Prasad
Kartik Prasad

Reputation: 740

Jenkins - Setting Environment Variable in execute script

I am using the Google Play Android Publisher Plugin, and trying to send the release notes for a language to the google play store. Currently they are in a file passed down from the previous build job and I am trying to set a environment variable from that using the following command in a execute shell build step.

export LANG_EN_GB=`cat android-*-en-GB`

I am then passing it into the recent changes field using ${LANG_EN_GB} but getting unrecognised macro.

Unrecognized macro 'LANG_EN_GB' in '${LANG_EN_GB}

I have searched online and have tried adding this command but it doesn't work

${ENV,var="LANG_EN_GB"}

I have also seen I can add the EnvInject Plugin but I am not keen to do that for such a small task. Is this the only solution or am I doing something wrong in the execute shell script?

Upvotes: 1

Views: 1182

Answers (1)

Kartik Prasad
Kartik Prasad

Reputation: 740

I fixed this by using referring to the File rather than a environment variable.

${FILE, path="android-en-GB"}

It seems the plugin,only works with environment variables set by Jenkins not by script

Upvotes: 1

Related Questions