3

I have a multi-configuration Jenkins job which runs my tests in parallel on multiple slave nodes. I want to collect some artifacts from those slave builds back on the master, and then run a post build step to build a custom HTML page from them.

I have everything set up so those files appear to be copied back onto the master, but then I can't seem to access them. Does anybody have a working example of this configuration that they can share?

Here's the job configuration of the matrix axes: axis_config and the build, which just creates a tmp.txt file: build and fingerprint, archiving artifacts and then post build step to copy that file back to the master: build_and_post_build_copy

The slave Console Output says the copy succeeded (and we can see from the plugin source code that any error would be reported - and I've definitely seen these errors getting logged when things go wrong):

17:39:23 [copy-to-slave] Copying '**/tmp.txt', excluding nothing, from 'file:/scratch/jenkins/workspace/Test%20Matrix%20Build%202/label/android/node_index/1/' on 'com.cloudbees.jenkins.plugins.mtslavescloud.MansionSlave@c9964fd8' to 'file:/home/<myaccount>/hudson_home/workspace/Test%20Matrix%20Build%202/label/android/node_index/1/' on the master.    

However, I can't seem to access those files from a Post Build script running on the master:

17:39:24 + cat label/android/node_index/1/tmp.txt    
17:39:24 cat: label/android/node_index/1/tmp.txt: No such file or directory    

The files seem to be listed in the Workspace of the master: master_workspace

I tried versions of the same command using the $WORKSPACE environment variable and they didn't work either, e.g.

20:40:13 + cat '/scratch/jenkins/workspace/Test Matrix Build 2/label/android/node_index/1/tmp.txt'    
20:40:13 cat: /scratch/jenkins/workspace/Test Matrix Build 2/label/android/node_index/1/tmp.txt: No such file or directory    

...and since "ws" was in the URL I tried adding that in as well (also didn't work):

20:42:51 + cat '/scratch/jenkins/workspace/Test Matrix Build 2/ws/label/android/node_index/1/tmp.txt'    
20:42:51 cat: /scratch/jenkins/workspace/Test Matrix Build 2/ws/label/android/node_index/1/tmp.txt: No such file or directory    
Dan J
  • 24,430
  • 17
  • 95
  • 168

0 Answers0