Configure (set) hudson slave environmentBy neokrates, written on April 26, 2010 |
howto |
- neokrates
- Email: uwarov@yahoo.com
- Website: http://www.thinkplexx.com
- Join date: 05-31-09
- Posts: 20
Loading ...
-
Since publication, this page was visited 887 time(s).
You have tried ~/.bashrc, ~/.profiles, /etc/environment, ~/.ssh/environment etc… but hudson slave fails to see your environment variables.
Fix is actually simple. Hudson doesn’t read slave environment each time you run the build.
You need to:
1 – set environment ;
2 – disconnect and reconnect hudson slave.
Software:
Hudson 1.355
Ubuntu Linux 9.x
Should also work for:
Other Hudson versions, most Unix systems
| 1 |
Set .bashrc and .profiles on slave
It might also work if you just add your variable to ~/.bashrc or ~/.profiles. In my case, I set THE SAME environment for both interactive shell and not interactive.
.profiles will use .bashrc.
Add to ~/.profiles:
source .bashrcAdd you environment variable to ~/.bashrc:
export MY_VARIABLE=MY_VALUE
IMPORTANT Here is a complete howto for SSH environment variables: Setting ssh remote host environment variables (Interactive shell)
| 2 |
Disconnect and reconnect Hudson slave
- Go to your node home : Hudson ? nodes ? my-great-node ;
- Select from the left menu disconnect;
- Then just click the button Launch slave agent
| 3 |
Test it
Simple check:
1 – create a free-style software project;
2 – add an Execute shell step
3 – command = env
4 – Tie this project to a node (your newly configured node)
5 – run and see that your environment variable is there
Have fun!
|
LEARN MORE (amazon bookstore)
|
|
TAGS
|
|
SOCIAL
|
|
INCOMING SEARCH TERMS
|


















