Clearing of Artifacts Drop location...

Norbert
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 12, 2012

Hi

I' have two stages in my Plan

  1. Stage: get code from repository (inkluding cleanup)
  2. Stage: build everything

I move the data from stage one to stage two via "Artifact" (see screenshot)

The problem is that the Artifact is only getting copied...
so files in the target folder are not deleted if I delete them in the repository..

I need to have an task running BEFORE copying the artifacts to cleanup the folder.

AFAIK this is not possible... How can I solve this problem?

2 answers

1 accepted

0 votes
Answer accepted
Norbert
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 12, 2012

Like, I said a little bit lacking ;-)

but thanks for the help I think I will go with the merging the stages solution

0 votes
Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2012

I don't quite understand what your problem is. Artifacts from each build are stored in different folder, (fresh dir for each build) so any leftover files shouldn't be an issue.

You can clean artifacts of old builds by configuring Build Result Expiry

Norbert
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 12, 2012

Hi

As far as i understand, the Artifact ist copied to the stage when there is a dependency
Exampel:

in the repository are 2 files, file_a, file_b, both are retreived in stage 1 and packed as artifact
the both files are copied to stage 2 (assume build root folder)
-> everything ok so far

then i delete file_b from the repository
stage1 retrieves the file and deletes file_b in the build folder..
then the file_a is copied to stage2..
but file_b isn't deleted in the root folder of stage2!

This is not a problem with old artifacts but with using artifacts..
The only solution would be to bring everything back to one stage so I don't need the whole "artifact" stuff..

Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2012

I see.

There's an option to clean working directory after build is finished.

It's in Job Configuration, Misc tab, checkbox: "<label>Clean working directory after each build</label>". This wipes everything from build working dir after the build is finished, so the next one starts at clean state.

Just make sure that any binaries you want to keep are defined as artifacts too.

Norbert
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 12, 2012

As I feared this raises the next problem...
I have a third stage, deliver the results..
this stage failes because stage 2 clean everything after its finished...

So here again there is the only solution to do the merge the two stages or to do the cleaning manually...
:-(

I'm more and more convinced that the your concept of stages/jobs/task is a little bit lacking :-(
espacially if developing an fat client and not a WebApp or something similar..

Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2012

Like, I said, define the results you want to keep as an artifact.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events