Configure (set) hudson slave environment

By neokrates, written on April 26, 2010

howto

  • Join date: 11-30-99
  • Posts: 224
View Counter:
  • 494 views
Rate it
Ad
Poll
  • Which test frameworks do you use?

    View Results

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext

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 .bashrc

Add 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

  1. Go to your node home : Hudson ? nodes ? my-great-node ;
  2. Select from the left menu disconnect;
  3. 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!

Be Sociable, Share!
 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: 0 (from 0 votes)
0 votes 'YES'  0 votes 'NO'


TAGS

SOCIAL
Be Sociable, Share!

INCOMING SEARCH TERMS


Leave a Reply