How do you tell a pipeline script which of multiple git paths to select? This could be multiple git versions or it could be differing paths between windows and linux node agents.
The tool path locations in Manage Jenkins > Global Tool Configuration are the "default" location.
This configuration can be overridden for a specific agent in the node configuration. Under Manage Jenkins > Manage Nodes > $NODE_NAME > Configure in the section Node Properties > Tool Locations. You can set the location of a specific tool on this agent.
From a job - or a pipeline script - the tool path used for the job depends on the node allocated. If the job runs on the master, the path defined in the global configuration is used. If it runs on a node, the path defined on the agent configuration is used and if there is none, fallbacks to the global configuration.
If you have more than one Git tool configured and you need to select between them in the Pipeline, please use a checkout step in Snippet Generator. It will give you an option called Git executable which will list all the available Git tools.
We found an obscure reference about what Denys said and can use that. And are.
As for Allan's suggestion, that would work except for a strange "problem". We are using cloud slaves set up in our CJOC. Since the CJOC can't install the Git plugin, git is not an option on the Global Tools config and we have to configure our Git tools at the master level. That means the Node Properties > Tool Locations on the Agent (which is configured on the CJOC) doesn't offer the possibility of entering a git tool.
I know the git plugin could be installed by upload on the CJOC. That's a workaround I haven't completely figured out because of all the plugin dependencies and possible conflicts. I have asked for an issue to be created to allow installing some additional plugins on the CJOC (including Git) so that Global Tools can set up configurations using them. Also so I can run a pipeline job that does customized backup of CJOC config. All the plugins that contribute content to the Global Tools config should be allowed on the CJOC. I haven't checked that the issue was created though.
We track a request to add more Tool Installations to Operations Center Shared Configuration as an internal JIRA issue CJP-5743. We are exploring alternative ways of managing the configuration of a cluster of Client Masters, so this issue is not on the immediate roadmap and might be superseded by a new solution.
Comments
5 comments
How do you tell a pipeline script which of multiple git paths to select? This could be multiple git versions or it could be differing paths between windows and linux node agents.
Hello Lee,
The tool path locations in Manage Jenkins > Global Tool Configuration are the "default" location.
This configuration can be overridden for a specific agent in the node configuration. Under Manage Jenkins > Manage Nodes > $NODE_NAME > Configure in the section Node Properties > Tool Locations. You can set the location of a specific tool on this agent.
See also How to Manage Build Tools on Client Master
From a job - or a pipeline script - the tool path used for the job depends on the node allocated. If the job runs on the master, the path defined in the global configuration is used. If it runs on a node, the path defined on the agent configuration is used and if there is none, fallbacks to the global configuration.
Hi Lee,
If you have more than one Git tool configured and you need to select between them in the Pipeline, please use a checkout step in Snippet Generator. It will give you an option called Git executable which will list all the available Git tools.
Thanks Allan and Denys for the quick response
We found an obscure reference about what Denys said and can use that. And are.
As for Allan's suggestion, that would work except for a strange "problem". We are using cloud slaves set up in our CJOC. Since the CJOC can't install the Git plugin, git is not an option on the Global Tools config and we have to configure our Git tools at the master level. That means the Node Properties > Tool Locations on the Agent (which is configured on the CJOC) doesn't offer the possibility of entering a git tool.
I know the git plugin could be installed by upload on the CJOC. That's a workaround I haven't completely figured out because of all the plugin dependencies and possible conflicts. I have asked for an issue to be created to allow installing some additional plugins on the CJOC (including Git) so that Global Tools can set up configurations using them. Also so I can run a pipeline job that does customized backup of CJOC config. All the plugins that contribute content to the Global Tools config should be allowed on the CJOC. I haven't checked that the issue was created though.
We track a request to add more Tool Installations to Operations Center Shared Configuration as an internal JIRA issue CJP-5743. We are exploring alternative ways of managing the configuration of a cluster of Client Masters, so this issue is not on the immediate roadmap and might be superseded by a new solution.
Please sign in to leave a comment.