Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what exactly does "archive artifacts" step do in Jenkins?

Tags:

jenkins

I have a Jenkins master server plus multiple slave machines that get created and destroyed all the time.

I could not find any documentation on what exactly "archive artifacts" option does in a Jenkins job.

does it copy artifacts from slave machine's workspace to some folder on master server?

or does it save files from the slave's workspace to the same slave's "archive" location? in this case if the slave server is destroyed, those files would be gone.

if I delete the workspace, will those archived artifacts survive?

if I delete builds history, will they survive?

etc

like image 669
Alex Avatar asked Oct 09 '15 18:10

Alex


People also ask

What does archive artifacts do in Jenkins?

archiveArtifacts : Archive the artifacts. Archives the build artifacts (for example, distribution zip files or jar files) so that they can be downloaded later. Archived files will be accessible from the Jenkins webpage.

How do you archive build artifacts in Jenkins?

Go to your client project and select configure. Create a post-build action and select 'archive artififacts' from the drop down menu. Add the type of files you want to archive (and eventually, copy and export).

What is archiving in Jenkins?

Archive of the artifacts in Jenkins is a feature that allows us to store the output files after we build the project with Jenkins. For example, you have an application project that uses Apache Maven to build. Normally we will use the “mvn clean install” command to build the Apache Maven application.

Where does Jenkins store archived artifacts?

By default, Jenkins archives artifacts generated by the build. These artifacts are stored in the JENKINS_HOME directory with all other elements such as job configuration files.


2 Answers

If you are talking about the "Archive the artifacts" post-build step, it copies the selected artifacts in the %JENKINS_HOME%/jobs/MY_JOB/builds/... on the master server.

So if you delete your slave or if you wipe your workspace, you won't lose your artifacts.

But if you delete a build or if you discard the old builds, you will remove the artifacts.

I hope it helps :)

like image 81
Bruno Lavit Avatar answered Nov 03 '22 23:11

Bruno Lavit


As Bruno stated it will "archive the artifacts" for that build back to your master.

One thing to note also though is if you use the "Discard Old Builds" plugin, which I would encourage, at the start of the page make sure you expand the "advanced" button and check your settings as there are additional settings for specifically for artifacts and retention.

like image 27
duffycb89 Avatar answered Nov 03 '22 21:11

duffycb89