2

I am making use of a batch script that is supposed to run on a slave node, which makes use of Sahi. The environment variable for Sahi is set as 'SAHI_HOME' on the node. When I run the batch I figure out, it is not able to locate Sahi classes. How do I enforce Jenkins to make use of environment variables set on the slave? I mean is there any way to fetch environment variables set on a slave node?

Sid06
  • 75
  • 1
  • 8

2 Answers2

3

We got around this issue by installing and updating Sahi automatically. There is a nice Jenkins Plugin: https://wiki.jenkins-ci.org/display/JENKINS/Custom+Tools+Plugin You just need to place a Sahi Zip somewhere for Jenkis to access. The custom tool plugin automatically unpacks archives and creates a toolname_HOME environment variable. Just name your tool SAHI and you have Sahi and $SAHI_HOME on every job and node you need.

Regards Wormi

globalworming
  • 757
  • 1
  • 5
  • 33
0

I ran into a similar issue with my AIX slaves. The issue is that the .profile file is not executed when a non-interactive shell is started. Therefore, you have several options.

  1. Make sure that the environment variable is set in the environment file (in AIX, I can set the ENV variable to a filename that will be executed for both interactive and non-interactive shells.) I think the .kshrc file might qualify too.
  2. Set the environment variable in the node configuration
  3. set the environment variable in the master configuration
  4. set the environment variable in the job (needs env inject plugin)
  5. set the environment variable explicitly in the bash script
Peter Schuetze
  • 16,185
  • 4
  • 44
  • 58
  • I dont want to set env variables manually on the node before running my script. Because I dont know where the Sahi would be installed on the slave (All I know is Sahi must be installed, without knowing location). So I just want to make use of env variables already set on my node. – Sid06 Oct 09 '13 at 12:54
  • see option 1. Or make sure that you run the .profile file at the beginning of your shell script. I don't think option 2 should be an issue either, you only need to find out the location when you configure the node. The script does not need to know about the location of sahi. – Peter Schuetze Oct 09 '13 at 13:52