Jenkins - Running a single job in master as well as slave

前端 未结 1 1051
渐次进展
渐次进展 2021-02-19 19:38

I have a master (linux) and a windows slave set up, and would like to build a single job both on the master and the slave. The \"Restrict where this project can be run\" option

相关标签:
1条回答
  • 2021-02-19 20:07

    Well, in Jenkins you can create groups of machine (either master or slaves), to do this :

    • click on the machine name on the first page of jenkins
    • enter in the node configuration menu
    • then, you can enter some labels in the Labels field. Let's add a mutli_platform label for example
    • go back to the first page of Jenkins
    • do it for each machine on which you need to run the job
    • go back to the first page of Jenkins
    • click on the job you want to run on multiple nodes
    • go in the configuration menu
    • check the Restrict where this project can be run and put the mutli_platform in it.

    Then, your build will be able to run on the mutli_platform label.

    For the second part, the multi-platform script, you can use ant builds, or python builds (with the python plugin).

    EDIT: If you need to build on the 2 (or more) platforms, you should use a Matrix Job. You will be able to create a job and force it to run on every slave you need.

    0 讨论(0)
提交回复
热议问题