Is it possible to run part of the task on the master, and the other part on the slave?

I am new to Jenkins. I have a requirement when I need to run part of a job on a Master node, and the rest on a node slave.

I tried searching the forums, but could not find anything related to this. Is it possible to do this?

If not, I will have to break it into two separate tasks.

EDIT

I basically have a job that checks the source code from svn and then compiles and creates jar files. After that, he creates a wise installer for this application. I would like to test and compile the source code on the master (Linux) and delegate the installation of Wise Installer to a Windows slave.

+4
source share
3 answers

This is definitely easier to do with two separate tasks; you can force the main task to start a subordinate task (or vice versa).

If you publish files that need to be attached to the installer, like assembling artifacts from the main assembly, you can pull them to the subordinate using the Jenkins URL and create the installer. To do this, use the assembly step of the post-construction "Artifact Archive" assembly.

+3
source

You can use the Multijob plugin , which adds the idea of ​​a build phase that simultaneously executes other tasks in parallel as a build step. You can still use regular jobs to create freestyle and post builds, as well as

+2

Pipeline Plugin , . Jenkins - node Pipeline script, node. , node, .

, Pipeline script :

node('linux') {
  git url: 'https://github.com/jglick/simple-maven-project-with-tests.git'
  sh "make"
  step([$class: 'ArtifactArchiver', artifacts: 'build/program', fingerprint: true])
}
node('windows && amd64') {
  git url: 'https://github.com/jglick/simple-maven-project-with-tests.git'
  sh "mytest.exe"
}

. ( , Workflow.)

+1

Source: https://habr.com/ru/post/1528007/


All Articles