Octopus Badges: Possible in latest versions?

Hi Octopus Team,

W.r.t these 2 queries

Do the current Octopus versions(s) support project badges to show deployment status in readme.md`?

Thanks
Nikhil

Hi Nikhil,

Thanks for getting in touch! Currently this feature is not available in Octopus. This is something we spent some time working on internally, though the project was never finished due to other features taking priority. It remains on our backlog as something that we may continue to work on in the future, though I’m not currently able to confirm if or when it would be implemented.

If you have any questions or thoughts here, please don’t hesitate to let me know.

Best regards,
Daniel

Hi @Daniel_Fischer,

Thanks for replying & no worries if it’s not ready.

As an alternative, can we get deployed version (not as fancy as a badge) from Octopus API? In the meantime, we could show that.

Thanks,
Nikhil

Hi Nikhil,

Sorry for the delay in getting back to you. I have just made up a quick example script to help get you started with this. I use the dashboard endpoint from the API as it records the latest deployed version for any project to any environment. You will probably want to filter things more than I have, this is a very simple script I made:

# Create endpoint and client
$endpoint = New-Object Octopus.Client.OctopusServerEndpoint("http://YourOctopusServer/", "API-KEY")
$client = New-Object Octopus.Client.OctopusClient($endpoint)

# Get default repository and get space by name
#$repository = $client.ForSystem()
#$space = $repository.Spaces.FindByName("Second")

# Get space specific repository and get all projects in space
#$repo = $client.ForSpace($space)

$envName = "Dev"
$deployments = $client.Repository.Dashboards.GetDashboard().Items | ? {$_.EnvironmentId -match $client.Repository.Environments.FindByName($envName).Id} # get all dashboard items where-object's environment id matches $envName value.

 # clear the variable if you run the script more than once., the += will re-add the values to the list. This cleans it before re-running. ## How to better handle? ##

foreach ($deploy in $deployments) {
    $client.Repository.projects.get($deploy.ProjectId).Name + " - " + $deploy.ReleaseVersion
    }

Example output:
Package Deployment Project - 0.0.6
Child deployment - 0.0.3
deploy cert - 0.0.4

I also explicitly define an environment here but you may want to check all environments. If you have any questions on this, please don’t hesitate to let me know.

Hope that helps you get started!

Best regards,
Daniel

Thanks, @Daniel_Fischer. This script would suffice my requirements.

Hi Nikhil,

Thanks for the update! We’re always happy to help.

Feel free to get in touch at any time. :slight_smile:

Best regards,
Daniel

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.