2
votes

I have a release pipeline that is specifically for running automated tests, that has multiple agent phases.

Most of the phases require use of the same artifacts in the same location on the build machine.

If I had an artifact set for download on a previous agent phase like so....

enter image description here

I used to be able to use that artifact again in subsequent agent phases, without downloading it again.

Now it appears to wipe the artifact folder contents when moving into a new agent phase. So if I have the following that follows the above....

enter image description here

The folder is wiped and the tasks that depend on that artifact existing fail.

Is there any way to prevent the build agent artifact folder from being deleted after an agent phase has finished and a new one starts?

1

1 Answers

1
votes

Since phases can run in parallel and can go from one agent to another and since it's unknown what job will be next on that agent, the jobs clean up once they finish.

The trick is to end each phase with a "Publish Pipeline Artifact" task and then download that artifact in the next phase.