Clearing of Artifacts Drop location...


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

Accepted Answer
0 votes

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

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


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

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..

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.

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..

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

490 views 0 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you