Scheduled release

We have the beginning of a deployment pipeline which is Dev UI tests, soon we are to add QA UI test and manual QA after…

However a request has come in that we have a single new environment that has the latest green deploy from the Dev ui test deployed twice a day if new. Let’s call it Dev showcase where senior staff can see where the Dev code stands.

This scheduled environment I don’t believe can be added to the existing pipeline as it’s automated to auto promote to the next environment once it’s passed. Whereas this new environment is to be scheduled. We don’t want a senior member of staff using this environment while it’s being released to as the system becomes unstable for a 15 minute period with databases being restored etc. So having a schedule during out if office hours works well.

What’s the best way to achieve this scheduled deploy based of the last successful Dev UI environment passed deployment?

Hi Jon,

If I understand you correctly, you have the following setup:

  • Dev UI Test
  • QA UI Test
  • … Maybe more phases afterwards

You want to deploy to a new environment (Dev Showcase). In terms of the lifecycle, this should fit in after deploying to Dev UI Test because you want to promote a successful deployment from Dev UI Test to Dev Showcase.

You can do this by modifying your lifecycle to match the following:

  • Dev UI Test
  • Dev Showcase (optional)
  • QA UI Test
  • … other phases

Here you can make the Dev Showcase phase an optional phase, which means that:

  • you can still promote deployments to QA UI Test once your Dev UI Test deployment is green.
  • you have to go through the Dev UI Test deployment before deploying to Dev Showcase.

You can read more about lifecycles and optional phases here: https://octopus.com/docs/key-concepts/lifecycles#Lifecycles-OptionalPhases

Octopus does not currently have any support for recurring scheduled deployments, although it is a commonly requested feature. You can read more about it on our UserVoice forum: https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/6599104-recurring-scheduled-deployments

You will instead need to create a scheduled task in some other system, where this scheduled task will tell Octopus to deploy the latest release to your Dev Showcase environment.

There are a number of ways you could prepare this scheduled task. If you are already using TeamCity, then this is probably the easiest option, as TeamCity has support for scheduling builds, and there is a TeamCity plugin for Octopus that you can use to deploy the release.

If you aren’t using TeamCity, then you could use a Windows scheduled task, or an Azure Function. There are a number of Octopus tools you could use to help you write this task. For example, you could use Octo.exe, or Octopus.Client, or access the Octopus REST API directly.

If you have a look at the comments on the UserVoice forum post, you will find a code sample that promotes releases from one environment to another: https://octopus.com/docs/guides/coordinating-multiple-projects/project-coordination-code-samples#ProjectCoordinationCodeSamples-Promotingagroupofprojects. You could use this as a starting point.

Hope that helps! Let me know if you have any further questions or need any help preparing the scheduled task.

Regards,
Tom