Some duration of steps in last-step notification mail

Hi! I’m beginner in Octopus and trying to automate CI at our company with your product.
I’m create nuget package with software and two scripts - before install (stop service, remove files except .config) and after install (reregister and start service). Finally, I’m want to send mail to me about operation status. My steps you can see here:

my question:

How I can put service downtime in notification mail ( this is equal of duration of all steps in deploying process)

Hi,

Thanks for reaching out! At the moment we do not have a variable that exposes the duration time of each step. We do have a github issue open for this, in which I just added a note referencing this same conversation to help building the case for the enhancement: https://github.com/OctopusDeploy/Issues/issues/3221#issuecomment-285089502

While you cannot have the time for each step, you could use Output Variables to capture the time at certain moments in the deployment and then calculate a diff between those.

How to create output variables: https://octopus.com/blog/fun-with-output-variables

I would roughly go like this:

  1. “Notify - Deploy Starting”
  2. “Set start time variable” which is a Powershell script step that will create an output variable with the current time. Make sure this step only runs on the Octopus Server and not in other targets.
  3. “Before Install”
  4. “Deploy”
  5. “After Install”
  6. “Set end time variable” which is a Powershell script step that will create an output variable with the current time. Make sure this step only runs on the Octopus Server and not in other targets.
  7. “Calculate Duration” which is a PS script step that will calculate the diff between the times on the vars created during “Set Start time variable” and “Set end time variable”. The diff result will be stored in another Output variable.
  8. “Notify Deploy - OK/Failed” This will send the diff result of the step “Calculate Duration”

Hope that helps!
Dalmiro

Given that you are just starting with Octopus, I would definitely recommend you to setup a test project and play with Output variables there before you change your current process. Output variables can be a tricky feature to learn :slight_smile:

Thanks for answer!

Set and calculate duration by using powershell variables is good idea. Yes, it’s enough. I’m

I was not sure that variables are persisted between steps.

Test environment already created and using for test some ideas (including multi-tenants projects).

I have two questions (and I think final questions):

  1. Copy package version to “Version” field after create new release (or clicking to radio buttons), screenshot http://i.tk-chel.ru/denisio/201703/20170308_2147_09.png. I think that will be comfortable for users.
  2. Do you have resellers in Russia or Europe Union? Russia resellers is preferred.

Thanks!

with regards, Denis Balashov. skype: denisio_work / tk.prog

TechnoKom Ltd.

tel: +7 (351) 225-05-55, 790-7296

fax: +7 (351) 796-04-24

E-mail: mailto:denisio@tk-chel.ru denisio@tk-chel.ru

web: http://www.tk-chel.ru www.tk-chel.ru

Hi Denis,

1. Copy package version to “Version” field after create new release (or clicking to radio buttons), screenshot http://i.tk-chel.ru/denisio/201703/20170308_2147_09.png. I think that will be comfortable for users.

This is already possible if you set the release version schema to be based on a step’s package version (see attached GIF). You can change this setting from Projects -> [Your project] -> Settings -> "Release Versioning"

2. Do you have resellers in Russia or Europe Union? Russia resellers is preferred.

Could you please send us an email with this query to Sales@Octopus.com? Our sales rep over there will be able to give you a hand with this.

Best regards,
Dalmiro

Thanks! Close ticket with “Successful solved” reason 

with regards, Denis Balashov. skype: denisio_work / tk.prog

TechnoKom Ltd.

tel: +7 (351) 225-05-55, 790-7296

fax: +7 (351) 796-04-24

E-mail: mailto:denisio@tk-chel.ru denisio@tk-chel.ru

web: http://www.tk-chel.ru www.tk-chel.ru