Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Jenkins store artifacts outside the job directory?

I currently have Jenkins set up with a number of jobs, but it's proving difficult to back up because the artifacts are stored within the job directory. I'd like to back up the job configurations and artifacts separately. I'm sure I remember reading somewhere that Jenkins now has an option to store them outside the job, but I can't find this.

Is there any configuration option that does this while still making the artifacts visible from within the job on the Jenkins interface? (ie rather than merely an add-in that copies the artifacts elsewhere)

like image 689
the_mandrill Avatar asked Feb 28 '12 13:02

the_mandrill


People also ask

Where does Jenkins store 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. There is no separation between infrastructure elements, project elements and outputs.

How do you save artifacts in Jenkins pipeline?

Normally, Jenkins keeps artifacts for a build as long as a build log itself is kept, but if you don't need old artifacts and would rather save disk space, you can do so. Note that the Maven job type automatically archives any produced Maven artifacts. Any artifacts configured here will be archived on top of that.

Where do you store building artifacts?

We recommend using Artifact Registry for storing build artifacts. Artifact Registry is a Google Cloud product that you can integrate with Cloud Build to securely store and manage your artifacts in private or public repositories.


1 Answers

Go to your jenkins configuration page, e.g.

http://mybuildserver.acme.com/configure

At the top of the configuration page there is a "home directory" setting. Click the "advanced..." button below it.

Now set the "Workspace Root Directory" to e:\jenkins-workspaces\${ITEM_FULL_NAME}, and "Build Record Root Directory" to e:\jenkins-builds\${ITEM_FULL_NAME} or something similar.

Warning: I run Jenkins 2.7.2 and noticed that certain features don't work properly after configuring Jenkins like that. I saw problems with folders and problems with the multi-branch project plugin. Check the status of those issues if your rely on these features.

like image 101
Wim Coenen Avatar answered Sep 20 '22 07:09

Wim Coenen