How to move the Jenkins slave files to Jenkins server and server can share these files?

945 views Asked by At

I have a job run on a slave, I will generate all logs on this slave, but I want to move this logs to Jenkins server because we always change the slave. After moving the logs to server, I also want to access to these logs from Jenkins job URL, like we go to the slave's workspace.

Anybody has some ideas? Thanks a lot.

1

There are 1 answers

1
Slav On BEST ANSWER

To copy from slave workspace back to master, you need Copy-To-Slave plugin. Nevermind the name, it supports copying both directions.

Any file in workspace can be accessed through the URL, however you don't want to rely on workspace as it's temporary by nature.

Instead, at the end of your build, select Archive Artifacts post-build action. Specify the files that you want to archive. Now you can access these artifacts of any previous build through the URL. The URL would be http://<JENKINS_SERVER>/job/<JOB_NAME>/<BUILD_NUMBER>/artifact/<path-to-file>