Dashboard for Environment Status

Hi,

I want to know if there is way to notify that a deployment is complete.

I am aware of the notifier which is there at the step level. This one is spamming the mailbox.
But i want to send out an email only after all steps are executed successfully.

Regards,
Mason

Hi Mason,

Thanks for reaching out.

I am aware of the notifier which is there at the step level. This one is spamming the mailbox.

Which notifier are you talking about exactly?

I want to send out an email only after all steps are executed successfully.

As I expressed in the previous question I’m not sure what your current setup is for notifications that you are getting an email per step. But you can add an Email step at the bottom of your process and set its “Run condition” to be “only when everything when ok” (See attached screenshot). This should send only 1 email only when everything was successful.

Regards,
Dalmiro

Hi Dalmiro,

We deploy multhiple projects like modules,websites, DB etc.to an environment
Right now the notifier is per project(I can play around with the run condition,send only when failed,success,always run).

My question is I want a single email notifier when all projects are deployed to an environment.
Hope im clear with the question.

Hi Mason,

Now its more clear, thanks.

I’m afraid there’s no such option yet in Octopus. Each project is quite isolated from the rest, and we don’t have yet a way to say “these projects are related, so do X once all of them are in X version in environment X”.

It wouldn’t be a bad suggestion to add to Uservoice if you are up to it: https://octopusdeploy.uservoice.com

One thing you could do though is create a separate project only dedicated to send notifications. This project could have a single step that hits the Octopus API to query for the status of certain Project/Environment/Release combination, and only send a notification once a certain criteria is met.

If that Idea makes sense to you, let me know and I can point you in the right direction of the API calls you might have to make.

Best regards,
Dalmiro

Hi Dalmiro,

Your idea might solve the thing, in that case i can select the projects which im interested in, collect status and send success/failure mail.

Please elaborate.

Regards,
Mason

Hi Mason,

Sorry for the delay here (*)

There’s an open source module called Octoposh that has a couple of cmdlets that query the Octopus API that might come in handy in your case. Specifically the cmdlet Get-OctopusDashboard

This cmdlet will return the information on the Octopus Dashboard as a collection of objects, which you can then filter to get the status of the latest deployments in your project.

Couple of tips to get started

  • Use -projectname to filter by the project you want to get info. Currently it only supports passing 1 project name at a time, so your either gonna have to run it once per project, or run Get-OctopusDashboard without parameters and then filter using the Powershell pipeline.

  • Same concept as above for -EnvironmentName.

  • Once you have the output objects, filter them by the properties ReleaseVersion and DeploymentStatus

Module site: http://octoposh.net/
Cmdlet wiki: https://github.com/Dalmirog/OctoPosh/wiki/Get-OctopusDashboard

Hope that helps as a starting point. Let me know if you need more help with this.

Regards,
Dalmiro

(*) The reason behind the delay is that I had to release a new version of Octoposh(i’m the project owner) that included the new Get-OctopusDashboard cmdlet. I rushed that a bit to be able to give you a useful reply :slight_smile:

Hi Dalmiro,

Thats great work man. I’m stuck with the installation part of OCTOPOSH.
I’m using Windows 10(FYI,both server and local). This has to be installed on the server hosting octopus?
I’m trying to install on my local, Find attached the version table.screesnhot

Please guide in the right direction. Im stuck right at the start.

Tried installing Win8.1AndW2K12R2-KB3134758-x64 (1).msu version of Windows Management Framework 5.0 in my local(see screenshot “capture”)

My concerns:
Where should i install?
What is the right version for Windows 10?

Capture.PNG

Hi Mason,

It seems like you already have the latest version installed. Are you able to run Install-module -module Octoposh -force? If you can’t, you can follow the guide on how to get started with the Powershell Gallery on their site: https://www.powershellgallery.com/GettingStarted

You can also download the code directly from Github and put it in the modules folder yourself as shown on the wiki: https://github.com/Dalmirog/OctoPosh/wiki/Installing-the-module#from-github

Let me know how that goes

Sorry forgot to answer your other questions

This has to be installed on the server hosting octopus?

Nope, this can run from any machine. That’s the goal :slight_smile:

I’m using Windows 10(FYI,both server and local)

Please know that Octopus is developed for and tested on server versions of Windows. Though we’ve seen users running Octopus on desktop OS, we do not provide support for those scenarios.

Cheers

Hi Dalmiro,

Was away for quite a lot of time. I found few things with the octoposh dashboard

  1. It is not finding projects which have spaces in their names. Same is the case with environments.
  2. It is allowing alphabet in the release version
  3. It is printing out duplicates of the result sets

I hope im clear… Please get back with fixes to go ahead

Hi there,

1) It is not finding projects which have spaces in their names. Same is the case with environments.

In Powershell you need to pass the name between quotes if it has a space. Like `Get-OctopusDashboard -ProjectName “Project with space”. This applies to all parameters.

2) It is allowing alphabet in the release version

That is ok because the version number can have “pre-release” tags like 1.0.0-alpha+001 as explained in the SemVer manifest

3) It is printing out duplicates of the result sets

I couldn’t reproduce this in any way. Maybe its somehow related to (1) and you need to pass the project name with spaces between quotes?

Best regards,
Dalmiro

Hi Dalmiro,

That(2) was a typo:
I used the following command:
get-octopusdashboard -environmentname ‘ZEN FT1’

  1. It is NOT allowing alphabet in the release version(alpha numeric release versions)
    See screesnhot attached

  2. Spaces between quotes resolved 1(project names and environments)

  3. Duplicates thing is still persisting when i try to get all projects in an environment. If i specify a project and an environment its acting correctly

  1. I’ve fixed this bug in the Development branch and will push it to Master in the next release. In the meantime you can download the branch with the fix from this link and then install it following these instructions

  2. I’m gonna need some info to check this:

  • Please run the command you are running to get the duplicate entries, send the output to a text file and then send me that file. Something like Get-OctopusDashboard -EnvironmentName development | Out-File $env:USERPROFILE\desktop\get-octopusdashboardOutput.txt -Force -verbose. Also let me know the exact command you are running so I can replicate it.

  • Browse /api/dashboard/dynamic and send me the full JSON you see on the screen (in a file attachment please)? I’d like to see the data the cmdlet is getting to build the final objects.

Hi Dalmiro,

I was busy with something else and totally forogt our conversation.I installed the new version and still see the same error.

I ran the following command:get-octopusdashboard -projectname database

the log is attached. Please find the attachment.

octoposh1.txt (12 KB)

Hi Mason,

That error should really have been fixed in this branch: https://github.com/Dalmirog/OctoPosh/tree/development

If you are absolutely sure you are using that branch version, can you go to your module path, go to \Scripts and send me the content of Get-OctopusDashboard.ps1?

You can get the full path of your module by running Get-Module -Name OctoPosh | select -ExpandProperty Path

Let me know how that goes,
Dalmiro

Hi Dalmiro,

I modified your commandlet to give me only status and implemeted that in a custom powershell. Its working great now.

Regards,
Nischith