Description
I am working on a new step that would let people execute arbitrary Groovy scripts (https://github.com/hiyainc/bitrise-step-groovy-script-runner). During testing in my own pipeline, though, I am unable to access environment variables I expect to be present. I use the standard JVM approach of calling System.getenv('BITRISE_BUILD_NUMBER')
(for example). When I test that in a bash script (with $BITRISE_BUILD_NUMBER
), I get the expected value. When I test it in my Groovy script, it's always a blank string (not even null). I have tested this same Groovy script locally, and System.getenv(...)
works as expected.
How does envman -- and indeed, Bitrise -- expose environment variables to steps?
To provide further examples, I have a step that has this output:
and I cannot access that env var in my groovy step which runs immediately afterwards. Just for the hell of it, I inserted a bash step between the two that does this:
#!/usr/bin/env bash
set -ex
echo -n $BITRISE_APK_PATH | envman add --key PROD_RELEASE_APK_PATH
and I also could not access PROD_RELEASE_APK_PATH
. This works when consumed from a bash script.
Thanks for your time.