List-latestdeployments lists all deployments and not just the latest

Hi

As per my earlier post in the Questions about scheduling deployments, I thought I’d use the octo.exe to grab the release number of the last deployment, but when running octo.exe list-latestdeployments with both --project and --environment specified, I get every single deployed from that project to that environment, which is not what the word “latest” means, nor meets the list-latestdeployments description of “List the releases last-deployed in each environment”

This is using Octo Tools 3.3.2 against a 3.2.24 server - is this expected or is the list latest not performing as it should?

Thanks
Gavin

Hi Gavin,

Thanks for reaching out. Definitely not working as expected. I’ve logged a github issue for this: https://github.com/OctopusDeploy/Issues/issues/2922

Do know that the fix for this will come for the latest versions of Octo.exe and the Octopus Server, so to be able to have them you’ll need to upgrade.

Regards,
Dalmiro

This so called fix has broken our rollback process for deployments. The switch is list-latestdeployments not list-latestdeployment. We are using this to return all deployments to a specific environment and displaying only the latest few as a roll back option for our test and production environments. This process has been working of over a year now and is now broken. Please return the original functionality and provide a way to only return the latestdeployment.

Thank you
Bruce.

I forgot to mention that the functionality isn’t consistent. When the --environment flag is used it only lists a single deployment, however is the flag is not included it lists all deployments for all environments. Running octo.exe with out the flag is correct and the addition of the environment returns unexpected results.

Hi Bruce,

Thanks for reaching out. I’ve logged a github issue to get this behavior fixed: https://github.com/OctopusDeploy/Issues/issues/3024

On it I also added an approach suggested by one of our devs to:

  • Return the latest 5 deployments by default (regardless of the --project or --environment)
  • Add a --top parameter where you can limit the results to > 5.

If you like that approach, feel free to give it a thumbs up on my comment: https://github.com/OctopusDeploy/Issues/issues/3024#issuecomment-267970304

About your broken deployment: how are you using Octo.exe list-latestdeployments for your rollback strategy? are you parsing the text output it returns? If you can explain me a bit more how you are using it, perhaps I can make an API script that returns similar info (in an object form) so you can use it instead of that command.

Best regards,
Dalmiro

Thank you for the response. I was thinking about this over the weekend as well. I thought a parameter such as -top would be a great addition and that the parameter could default have a default value and it could be overridden to any length by the user.

As for how I am using octo.exe for my roll-back.
We are using Jenkins to manage all of our builds and promotions.
After calling create-release and deploy-release jobs, I run a PowerShell script that takes the list of all deployments from the just deployed job and parses it for successful job version.
The list of version numbers are then sorted and stored.
This list contains the latest deployed version as well the desired number of successful versions available for roll-back. (configurable in the PS Script)
From then on when the deployment is run it presents the currently installed version as well as the available to install versions. ( screen shot from an older job)

[cid:85FED6B2-9AD6-4024-AACF-90CB060400C0]

The current version of octo.exe only returns one entry to fill the list.

Thank You,

Bruce

Versions_To_Deploy.png

Hello Dalmiro,

I had another thought on this.

The option “–list-releases” does not have a “—environment” flag. This flag would do the trick if the return list contained success/failure information for each release in the environment.

If the list-releases contained this information the list-latestdeployments would not need to be changed. It might be a better place to put the functionality as well.

Thank You,

Bruce

image001.png