Jenkins - Launching solo work in both the lead and subordinate

I have a master (linux) and a Windows slave, and I would like to create one task on both the master and slave. The option "Limit where this project can be launched" allows us to link the task to a specific slave, but is it possible to link one task to the leader, as well as to the subordinate? How to configure the “Build Step”, since running it on Windows requires a build with Windows commands, and Linux requires a shell command. For example, even if a task tries to run on the master and slave devices, will it fail at some point, since it will be executed as build parameters (with the package and shell command)?

+8
jenkins
source share
1 answer

Well, in Jenkins you can create groups of machines (both master and slaves) to do this:

  • Click on the machine name on the front page of jenkins.
  • go to node configuration menu
  • then you can enter some labels in the Labels field. Add mutli_platform shortcut e.g.
  • back to Jenkins front page
  • do it for every machine you need to complete the task
  • back to Jenkins front page
  • click on the task you want to run on multiple nodes.
  • go to the configuration menu
  • check Restrict where this project can be run and put mutli_platform in it.

Then your assembly will work on the mutli_platform label.

For the second part, with multiple script platforms, you can use ant builds or python builds (with the python plugin).

EDIT: if you need to build on 2 (or more) platforms, you should use Matrix Assignment . You can create a task and make it work on each slave device that you need.

+12
source share

All Articles