Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins: Copy data from slave to slave

let's say we have got the following scenario:

  1. I have two slaves on Jenkins: S-1 und S-2.
  2. I have two Build Jobs BJ-1 und BJ-2. (BJ-1 is running on S-1, BJ-2 on S-2.)
  3. BJ-1 generates data in his workspace
  4. BJ-2 needs the data created bey BJ-1 in his own workspace

How can i solve this problem WITHOUT copy all the data to my master. I know i can copy the data of BJ-1 on S-1 to my master server, once the job is done and i also know i can download the data to S-2 before BJ-2 runs. But as you see i have to copy them to my Master.

The question: Is there a way to directly copy the data from S-1 to S-2?

like image 765
Krummy Avatar asked May 22 '14 09:05

Krummy


1 Answers

Best way to achieve this is to archive your generated data in the post build steps in BJ-1 and copy then artifact to BJ-2 workspace.

BJ-1

Archiving artifacts is built in to Jenkins and allows you to define a file set to be available as part of the build results. Extend BJ-1 to configure what data should be archived BJ-1 configuration example. With that the archived data is available for further use.

BJ-2

In order to pick up the archived artifacts from another job you will need to install the Copy Artifact Plugin. In BJ-2 you add a new build step to copy artifact from a named build - with that any files matching the configured pattern will be copied into the current job's workspace. BJ-2 configuration example With that you can access any kind of artifacts across jobs/slave nodes etc.

like image 84
MrsTang Avatar answered Nov 03 '22 02:11

MrsTang