Extract data from package to use in notification?

We have some configuration files stored in source control. IE, config.test, config.stage, config.prod. after the deployment I want to end up with a config that is specific to my environment. So I wrote a powershell script to pass an environment variable to which will delete / rename the files based on the environment. This works great, but I want to extract some information from the config file to use in a notification email.

I realize, that the data the changes “should” be stored in octopus as variables and replace the data in a single config file which would then also be available in my notification email. I think the problem is the amount of config data, I would rather store this data in 3 separate files than have to create variables for everything.

Given this process however, is there any way to get this data from the config? i dont want to duplicate it in octopus variables, just extract it from the config. Sure I could run some other external process that extracts the config data and sends an email, but then I lose the Octopus Context… Please advise, thanks.

Hi Gavin,

While you could use PowerShell to extract the data and even provide the data to Tentacle (so that other conventions in Tentacle can use the variables you extract), there’s unfortunately no way currently to pass that information back to the Octopus server to use when creating your email in another step. Unfortunately you may have to look into sending the email yourself from within the PowerShell script.

Paul

Yeah, I did that wan it works fine… However, the script is PostDeploy.ps1 which doesn’t really run post-deploy because there are more steps in the Project.

So, the email ands up getting sent 5 minutes before I want it to. It would be nice to provide Extensible Hooks in the deployment process or some plugin model that could load my assemble at Step X and invoke method Y passing variables ZZZ

Hi Gavin,

Expect to see something like this in Octopus 2.0 :slight_smile:

Paul