Quantcast

Help with artifacts archiving

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Help with artifacts archiving

Mauro Molinari
Hello,
I'm quite new to Jenkins and I need some help with archiving artifacts.
I have my project and I can build it correctly.
Then, in the project configuration I set:

Promote builds when...
Only when manually approved
Actions: 
1) archive the artifacts; files to archive: master/build/distributions/*
2) keep build forever

The first problem I see is that I can't promote a build which was done before I enabled the "Promote builds when..." check box: there's no "Promotion status" link for it. Anyway, that link appears for builds made after the option was enabled, but even if the promotion seems to go successfully, I can't understand where the archived artifacts are put and/or how I may be able to access them.

In fact, I don't see any new link in the build page, nor in the project page. I just see that my promoted build is marked to be kept forever.

Thanks in advance for any help,
Mauro.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help with artifacts archiving

Sami Tikka
I'm not sure it is even possible to archive artifacts in a build promotion action. The Promotion plugin probably just collects all actions into the list of promotion actions regardless if they make any sense or have been tested to work in the promotion context. The promotion does not have its own artifacts page where the artifacts would be available.

The promotion is really kind of a hidden job that runs using the same workspace as it's parent job. At the time the promotion runs, the parent job workspace might not contain the files you expect because a new build of the parent job may have checked out/built newer files. Or the workspace may even have been deleted! It is best practice not to look at the files in the workspace in the promotion. It might even be safest to merely trigger another job to any actions that requires a workspace and files.

If I understand correctly, you are trying to build something, then maybe run some tests on it and if the tests pass, promote the build and only then archive the artifacts, so you do not waste disk space saving bad builds.

I myself archive the build artifacts when the build is done, then test the builds and if the tests pass, I promote the build. Essentially, I archive all builds, but I just have enough disk space not to care about the builds that failed during tests.

-- Sami

Mauro Molinari <[hidden email]> kirjoitti 27.7.2012 kello 16.26:

> Hello,
> I'm quite new to Jenkins and I need some help with archiving artifacts.
> I have my project and I can build it correctly.
> Then, in the project configuration I set:
>
> Promote builds when...
> Only when manually approved
> Actions:
> 1) archive the artifacts; files to archive: master/build/distributions/*
> 2) keep build forever
>
> The first problem I see is that I can't promote a build which was done before I enabled the "Promote builds when..." check box: there's no "Promotion status" link for it. Anyway, that link appears for builds made after the option was enabled, but even if the promotion seems to go successfully, I can't understand where the archived artifacts are put and/or how I may be able to access them.
>
> In fact, I don't see any new link in the build page, nor in the project page. I just see that my promoted build is marked to be kept forever.
>
> Thanks in advance for any help,
> Mauro.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help with artifacts archiving

طلال Anthony رابعة
In reply to this post by Mauro Molinari
Hello,

I have a similar process.  Promotions can't archive the artifacts so what I did instead was create a second project…

* First project runs.  If successful, it creates an artifact of the distribution.
* If promoted, it calls on the second project to perform the task.
* Second project uses the copy plugin to copy the artifact into its workspace and perform actions.
* Both first and second project get marked as keep forever.

It means the first project will be bloated with artifacts.  Jenkins is running on a server with a 300 Gig HD to account for this (each distribution is one gig).

Cheers!

   Anthony

On 2012-07-27, at 9:26 AM, Mauro Molinari wrote:

> Hello,
> I'm quite new to Jenkins and I need some help with archiving artifacts.
> I have my project and I can build it correctly.
> Then, in the project configuration I set:
>
> Promote builds when...
> Only when manually approved
> Actions:
> 1) archive the artifacts; files to archive: master/build/distributions/*
> 2) keep build forever
>
> The first problem I see is that I can't promote a build which was done before I enabled the "Promote builds when..." check box: there's no "Promotion status" link for it. Anyway, that link appears for builds made after the option was enabled, but even if the promotion seems to go successfully, I can't understand where the archived artifacts are put and/or how I may be able to access them.
>
> In fact, I don't see any new link in the build page, nor in the project page. I just see that my promoted build is marked to be kept forever.
>
> Thanks in advance for any help,
> Mauro.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Help with artifacts archiving

Mauro Molinari
In reply to this post by Mauro Molinari
Hi Sami, hi Anthony,
what I need to do is actually what Sami says. I do not want to always archive the artifacts of all builds, since I don't have so much space. That instance of Jenkins is meant to be populated with dozen projects and it might be used to build "test" builds or to make "release" builds. I found it a good solution to create a promotion job called "Release" that I manually trigger when I want to promote a build to be a "Release" build. Then, I want artifacts from that build to be archived, so that they are downloadable even if the workspace is later used for making other new builds.

I then found this bug: https://issues.jenkins-ci.org/browse/JENKINS-13447
Artifacts can actually be archived at promotion time, the problem is that the Jenkins UI is not updated in order to make any link to the archived artifacts available.

I think I have to find another solution meanwhile... :-(

Thanks for your help,
Mauro.
Loading...