What Jenkins copies from slave to master when a build finishes?

10,167 views
Skip to first unread message

Alan Evangelista

unread,
Jun 26, 2015, 12:37:29 PM6/26/15
to jenkins...@googlegroups.com
Jenkins copies only files saved to a specific diretory (eg job workspace) or any file created by the build (even if outside the workspace)? My tests seem to point to the latter, but I do not know how Jenkins would know all files created by a build, if not restricted to a specific directory.

Ginga, Dick

unread,
Jun 26, 2015, 12:42:16 PM6/26/15
to jenkins...@googlegroups.com

By default, Jenkins copies no files from the slave to the master except the build log. You need to explicitly move files via Archive, Publish, Copy, etc

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/56de11c3-b73d-47c3-9305-3f32e60a2f4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alan Evangelista

unread,
Jun 26, 2015, 1:16:00 PM6/26/15
to jenkins...@googlegroups.com

RG>  By default, Jenkins copies no files from the slave to the master except the build log. You need to explicitly move files via Archive, Publish, Copy, etc

Where is file copying/moving from slave to master setup? In the job configuration?
- I only have a git clone, some string parameters and a "execute shell" step in my job configuration. The "execute shell" step does not copy data to master.
- I save all output to /srv/share/jenkins/jobs/<job_name>/builds/<build_id>/
(directory I chose) in the "execute shell" step in the slave
- output shows up in /opt/jenkins/jobs/<job_name>/builds/<build_id>/ in master


Using version 1.606

Ginga, Dick

unread,
Jun 26, 2015, 1:50:31 PM6/26/15
to jenkins...@googlegroups.com

Well I am not a Linux guy but is /srv/share a folder mapped to your Jenkins server? Then that would be a manual copy step.

 

If /srv/share is a local folder on your slave, then I do not know how it is getting to your master.

--

You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Alan Evangelista

unread,
Jun 29, 2015, 10:32:10 AM6/29/15
to jenkins...@googlegroups.com
RG> Well I am not a Linux guy but is /srv/share a folder mapped to your Jenkins server? Then that would be a manual copy step.

No, there is no NFS setup between master and server.

RG> If /srv/share is a local folder on your slave, then I do not know how it is getting to your master.

That's indeed the case.


Are you sure Jenkins does not copy the artifacts created in a job automatically from slave to master? I read differently in chapter 11 (Distributed Builds) in a book named "Jenkins - The Definitive Guide", author John Ferguson:

"In all cases, the fact that a build job is being run on a slave, and how that slave is managed, is transparent for the end-user: the build results
and artifacts will always end up on the master server."

Eric Pyle

unread,
Jun 29, 2015, 10:49:45 AM6/29/15
to jenkins...@googlegroups.com
The Jenkins book is correct, but the terminology can be misleading. Artifacts and build results will indeed be stored on the Jenkins master. However, "build results" include only success/failure, console log, and other things Jenkins and your plugins use to perform their functions. "Artifacts" will only include those files specifically designated as artifacts in "Archive the artifacts" under post-build steps. Any other files in the workspace will not be transferred. So although you may think of various files created by your build as artifacts, Jenkins has to be told which ones you want to archive (store on the master).

Eric
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Alan Evangelista

unread,
Jul 1, 2015, 6:15:38 PM7/1/15
to jenkins...@googlegroups.com
EP> The Jenkins book is correct, but the terminology can be misleading. Artifacts and build results will indeed be
    > stored on the Jenkins master. However, "build results" include only success/failure, console log, and other things
    > Jenkins and your plugins use to perform their functions. "Artifacts" will only include those files specifically designated
    >  as artifacts in "Archive the artifacts" under post-build steps. Any other files in the workspace will not be transferred.

That was very clarifying, thanks!

I was wrong before, there was a NFS share between the master and the slave, that explains the behavior I was seeing.

corneil....@gmail.com

unread,
Jul 2, 2015, 5:06:29 PM7/2/15
to jenkins...@googlegroups.com
There are multiple plugins that can help with the kind of thing you want to do.





The build output and the results record by plugins like xUnit will be sent to master.
If you want to preserve any files you will need to send them to a specific location using one of the 'Publish over' plugins and then use copy-data-to-workspace or copy-to-slave plugins to restore the files at start of build.

The workspace should be treated as potential throwaway and it is a bonus if it has been preserved.

If you want to ensure the output artifacts are preserved enable 'Archive artifacts' or publish your artifacts to a binary repository like Artifactory, Archiva or Nexus.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages