Configure (set) hudson slave environmentBy neokrates, written on April 26, 2010
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.
Ubuntu Linux 9.x
Should also work for:
Other Hudson versions, most Unix systems
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:
Add you environment variable to ~/.bashrc:
IMPORTANT Here is a complete howto for SSH environment variables: Setting ssh remote host environment variables (Interactive shell)
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
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
LEARN MORE (amazon bookstore)