Hi,
I have a project that has 100+ environments in it.
Each environment has 1 - 5 machines in it that need to be patched
When deploying a patch, that patch may generate between 1 - 10 log files that are collected as artifacts, each named as the environment and machine so I know where they came from.
I am trying to find a way that I can download the entire collection for the release in one go (there could be thousands). I can then feed these into an analysis engine.
Hello all,
I modified the above resource a bit to get the resource below.
It almost gets me what I need.
This gets me all the artifacts from every machine in the release.
Now I have been tasked with getting only the artifacts from those tasks that failed to deploy.
Thanks for getting in touch! Whilst this could be possible via the API, I think there are better solutions available.
Working with the REST API quickly becomes complicated and often not something we suggest. Where possible we suggest using the Octopus.Client (Some examples) or our SwaggerUI to interract with the API.
However, there is still no preformed script available from us which does what you are after here. I discussed this with our team and we believe the below option is a better alternative to using the REST API.
Instead of collecting these artifacts after the deployment, you could try collecting them at the end. You could use a script at the end of your deployment to copy the artifact to a shared location. You can have Octopus only copy the artifacts if the deployment failed by using our Variable Substitution Syntax and some run conditions (Step only run if the deployment fails). You could then collect the artifacts from this single location.
Let me know if you have any thoughts or questions here.