When are artifacts deleted?

Hi,

We’re using semaphore artifacts presently to persist built objects between their build and test jobs. We currently use an epilogue in the test job to yank (delete) the created artifact.

This leads to a race condition where all values of the test env var will attempt this yank, so if one test finishes before another starts (rare, but not impossible) the starting test will not be able to find the artifact.

I would like to know if/when workflow artifacts are deleted automatically. If they are, could someone point out where in the documentation this is stated. Looked myself but couldn’t spot anything.

Thank you for your time.

Hi there!

Semaphore does not automatically delete the artifacts archives at any point. However, you could manually set an expirate date for them when uploading. This can be done with the --expire-in flag: https://docs.semaphoreci.com/reference/artifact-cli-reference/#uploading-artifact.

Alternatively,you can bootstrap up with the Artifacts Cleanup promotion that would perform artifact workflow yank on these artifacts regardless of the pipeline result: https://docs.semaphoreci.com/reference/pipeline-yaml-reference/#the-epilogue-property.

Best,

That’s excellent information, thank you.