I have the following scenario.
I tried a simple pipeline job that clones my remote repo. It works fine when i set it to execute on master.
node {
//stage 'Checkout'
git([url: 'ssh://[email protected]:29418/bla/bla.git', branch: 'mybranch'])
}
It uses the default git installation to run the command. I have configured git on a different pat for slave in jenkins configuration. when i try to run the same pipeline on a slave, it fails because it always tries to go the default git installation.
node ('myagent1'){
//stage 'Checkout'
git([url: 'ssh://[email protected]:29418/bla/bla.git', branch: 'mybranch'])
}
The error is obvious:
Caused by: hudson.plugins.git.GitException: Error performing command: /jenkins-master-some-path/bin/git init /home/user/workspace/pipeline
/jenkins-master-some-path/bin/git
is correct for master.
For normal jobs, we can choose one installation but can someone tell me if there is a way to use different git installation for pipeline on a slave.
Another solution, that will work with all the tools, is to configure specific tools installations path for your specific agent node.
Go to :
... and then select the tool that cannot be found on your agent (e.g. Git executable) and just fill there your executable path.