Issue Details (XML | Word | Printable)

Key: HUDSON-3605
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: againjj
Reporter: mbetter
Votes: 3
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hudson

provide access to arbitrary environment variables

Created: 30/Apr/09 04:31 AM   Updated: Tuesday 04:36 PM   Resolved: Tuesday 04:36 PM
Return to search
Component/s: email-ext
Affects Version/s: current
Fix Version/s: None

Environment: Platform: All, OS: All


 Description  « Hide

It would be useful to be able to access other environemnt variables, apart from
the predefined ones. The user should be able to set such variables in a build
step, and then access them as tokens in the e-mail template.



Sort Order: Ascending order - Click to sort in descending order
mindless added a comment - 06/Jan/10 04:31 PM

Implemented in r15326 by againjj.
Included in email-ext 2.3, released today.


rajpra added a comment - 18/Mar/10 09:05 PM - edited

I found a issues with this fix.

the environment variables displayed are system ones only. So if part of the build script you set a environment variable which you want show in the email, you cant.
eg.
If in Linux build script i add.

export COPY_PATH=/var/app/$BUILD_TAG/

In the Hudson email config I would like to say:

Build has been copied to ${ENV, COPY_PATH}
But when i do this, nothing is displayed.


rajpra added a comment - 18/Mar/10 09:37 PM

same type of issue


rajpra added a comment - 18/Mar/10 09:38 PM

related.


mdonohue added a comment - 19/Mar/10 06:07 AM

That is not the way environment variables work. When you set an environment variable in a child shell, it is not accessible by the parent. You need to have the copy path set as a Hudson parameter.


dcoraboe added a comment - 22/Apr/10 07:22 AM

This case happens also for some parameterised builds.

Our build is parameterised by a SOURCE_BUILD_NUMBER variable.

The mail contains the reference ${ENV,SOURCE_BUILD_NUMBER} as indicated in the help, but this value is not replaced.


mindless added a comment - 07/Sep/10 04:36 PM

reclosing.. export from subshell is invalid, as mentioned, and getting values from parameters is tracked in a separate issue: HUDSON-7075