Strategy for Dev/Main branches and deployment pipelines

Hi

Octopus worked for us well in simple project setup. But as soon as things get complex I struggle with the best practices.

Here is our set up: we have Dev and Main branches in source control. Dev is for everyday work and new features. On release day we merge stuff from Dev into Main. And create a release build from Main that is deployed.

We deploy nightly to our unstable server from Dev - some sort of pre-release version. Then we deploy to production only from Main. The deployment pipelines are almost identical (no need to take DB-backup for pre-releases, but that is a separate discussion).
So Unstable server represents Unstable environment.

Also we have UAT and Production. To these environments we only deploy stuff from Main branch and pre-relases should never get there.

My idea at the moment is to generate octopacks with different names from Dev and Main: MyProject-Pre and MyProject. The -Pre package only gets deployed to Unstable environment. Release packages go only to UAT and Prod.

What I’m struggling to come up is what should Octopus Lifecycle look like? And does this set up sounds OK to you? are there better ways to do what I want to do?

Many thanks,
Max

Hi Max,

Thanks for getting in touch! Hopefully I am understanding this situation correctly.
I think that two projects, one just for your Dev branch and a Lifecycle that can only be released to Dev, and then a project for UAT and Prod for your main branch and a Lifecycle strictly for those.
You could match up releases to package versions to get a sense of where Dev is compared to UAT or Prod, but as there is no overlap, using a dynamic package name to have two packages on one project doesn’t necessarily make sense here because you never release dev to UAT and prod, and you never release main to dev.

If I am missing something please let me know!
Vanessa

Vanessa,

Thanks for the info, it does make sense. The only problem now how to sync process between the projects? If I update the Octopus process steps in Dev project, I don’t really want to update the same steps manually in Main project.

Is there some sort of template that will allow to update in one place an propagate the changes into both projects?

Many thanks,
Max

Hi Max,

You could make use of Step Templates and Variable Sets. That way each project uses the same sources for both and one place to manage them.
Branching support when it comes will solve this problem for you as you can have two branches with a Lifecycle each and one project.

Vanessa

Thanks, Vanessa. I will give this a go.