-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
Platform: All, OS: All
It appears that environment variables available in the Hudson configuration
(i.e. visible in the Hudson System Information page) are NOT passed to Ant
builds when Hudson launches a configured Ant installation.
This does not seem intentional. Is this by design?
For example, I declare an environment variable MYSTERY='This is a puzzler' and
make it available in the shell by which I launch Hudson (java -jar Hudson.war)
I add an <echo> statement in my Ant build script to print out the value of this
env variable. When running Ant outside of Hudson, the value of MYSTERY is
displayed properly. When running Ant inside of Hudson, the value is not
resolved even though Hudson displays the value of MYSTERY properly in the
Environment Variables section of the System Information page.
This seems unexpected.
Is this a known issue?
- is duplicated by
-
JENKINS-6013 Passing Hudson env vars to Ant stopped working
-
- Resolved
-
Same problem here. I have an ant task that uses ${env.HOSTNAME} to pick up a .properties file depending on the hostname of the machine.
It turns out that that specific variable doesn't expand, although many others do just fine.
I checked System Information, and HOSTNAME is correctly set under Environment Variables. Echoing the properties filename I get this, though:
[echo] /mnt/slave/workspace/Platform_develop_Build-Common/git/Common/${env.HOSTNAME}.build.properties