Rename Filename on the Artifacts

I’m currently trying to implement a database deploy review step within our deployment. I’ve been using the Redgate create database step and it produces 3 different files for each step. The problem is our solution contains 18 separate databases which means it’s incredibly difficult to review the files in their current state. I’ve tried using rest API to update the value but after I call the put method the data remains the same. Is there any other way that I can update the artifact file name?

Hi Shawn,

Thanks for reaching out. Its not possible to modify artifacts once they’ve been created.

What I’d personally do is tweak the lines RedGate step template powershell script that creates the artifact to either:

A) Create the artifacts with the name/folder structure you want using a runtime variable like the database name.

B) Remove the lines that create the artifacts and instead have it move all the logfiles to a single folder. Then at the end of the deployment, have a PS step to name all the files the way you want them and push them as artifacts.

Here’s some info on how you can modify the code of the step templates: http://docs.octopusdeploy.com/display/OD/Step+Templates

The lines you should be tweaking/removing are the last 3:

# Import the changes summary, deployment warnings, and update script as Octopus artifacts, so you can review them.
New-OctopusArtifact "$exportPath\Reports\Changes.html"
New-OctopusArtifact "$exportPath\Reports\Warnings.xml"
New-OctopusArtifact "$exportPath\Update.sql"

Hope that helps!
Dalmiro

Dalmiro,

I just wanted to let you know that was a fantastic suggestion. One of my other requirements was to not create an artifact if there are no changes and this suggestion solved both of the problems. Thanks again!

Thanks,

Shawn

Glad to hear that Shawn!

Cheers