I have 2 RHEL installations in a Master / Slave configuration using Jenkins ver. 1.609.2
The slave runs through the SSH Slaves 1.10 plugin.
I am trying to use Slave Setup Plugin v 1.9 to install the tools that my slave machine will need to run assemblies. In particular, I am installing sqlplus.
Here is the script that I run to try installing sqlplus:
if command -v sqlplus >/dev/null; then echo "sqlplus already setup. Nothing to do." else
This script runs successfully and everything works until I try to run the build and execute the sqlplus command. Build failed because sqlplus not a recognized command.
My main question is: What is the correct way to automatically add an environment variable when the slave starts?
Please note that I am looking for a way to automate . I do not want to go into the configuration screen for my slave device, check the checkbox and specify the environment variable. This is counterproductive to what I am trying to achieve, which is a subordinate that you can immediately use to build after connecting.
I really understand why my script is not working. When Jenkins starts the slave, it first makes an SSH connection and then launches my setup script using the command
/bin/sh -xe /jenkins/tmp/hudson8035138410767957141.sh
Where the contents of hudson8035138410767957141.sh is my script on top. Obviously, export will not work . I was hoping adding the export to the .bashrc would work, but that would not work. I think this is because this script is executed after the ssh connection is established and therefore .bashrc has already been read.
The problem is that I cannot find a way around this limitation.
Fgreg source share