Configure (set) hudson slave environment

By neokrates, written on April 26, 2010

howto

Rate it
  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
Ad
Poll
  • Which Selenium configurations do you use to test your web front end?

    • We use other tool (80%, 12 Votes)
    • Selenium Grid (13%, 2 Votes)
    • Selenium Grids under CI (like Hudson or TeamCity) (7%, 1 Votes)
    • Single Selenium (0%, 0 Votes)
    • Many Selenium grids on one Server (0%, 0 Votes)
    • Other config (0%, 0 Votes)

    Total Voters: 15

    Vote

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
Most popular search terms:

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:

[v] Hudson 1.355
[v] Ubuntu Linux 9.x

Should also work for:

[v] 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!

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

LEARN MORE (amazon bookstore)

TAGS

RELATED
Pages
Posts
    nope :(

SOCIAL
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • Blogosphere News
  • E-mail this story to a friend!
  • Furl
  • LinkArena
  • Live
  • MisterWong
  • Print this article!
  • StumbleUpon
  • Technorati
  • Webnews.de
  • YahooMyWeb

INCOMING SEARCH TERMS


Leave a Reply