简体   繁体   中英

Selecting git executable in Jenkins Multi-configuration project depending on axis

I've got a Multi-configuration job in Jenkins.

Currently it has 2 axes, one for build type with values "Debug" and "Release" another one with 2 values too, setting some preprocessor macros.

I'd like to add one more axis with build platform: Windows or Linux.

My project is stored in git, and the "Source code management" part of the Jenkins job configuration contains configured "Git executable", chosen from the drop-down list.

As I understand, this list is formed from global Jenkins settings. My Jenkins has 2 git executables configured, one for linux slaves, and one for windows slaves.

However, this multiconfig job uses only one executable, "Default", configured for Linux slaves.

This makes me keeping 2 Jenkins jobs, one for windows, and one for linux. Some inconvenience of this setup is that build results appear in different locations.

Is there any way to choose this parameter depending on axis value?

One can override default git location in the settings of the node.

Manage Jenkins -> Manage Nodes -> select windows node -> Configure -> Node properties in the lower part of the page.

Then check "Tool locations" checkbox and add path for default Git. Not sure, if spaces in paths are properly supported, didn't check.

在此处输入图片说明

Next tricky thing will be development of universal scripts , that run both in Linux Bash and in Windows CMD. Less tricky alternative is rewriting all my build scripts to some cross-platform language.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM