Multiple P4 Streams/branches to the same environment, automatic builds

I have a project with several windows services and several long-running branches. We typically have multiple branches in one environment at a time. How do I make the automatic deployments only deploy the correct branch thats already in that environment? We have a file in each service that identifies all the build properties including the branch so I could read that if necessary?

Hi @Smayer,

Thanks for getting in touch! From the information you have provided, it does sound like Channels will help you out here if you are not already using them.

Channels are the feature we designed to manage multiple branches and things like Hot-Fix deployments.

When you create a channel in your project, you specify a Lifecycle to associate with the channel, then you define version rules and associate a package step with the version rule. Version rules let you control which package you want associated with that Channel.

Our documentation on the subject has a lot more detailed information and instructions and well worth reading through if you have not yet looked into it.

After you have created a Channel with the lifecycle and version rules specified, you can enable Automatic Release Creation, specify a package step and Channel, then have Octopus automatically create release to the channel for any package which matches the version rules.

If you have any questions about using Channels or run into any issues at all, please do not hesitate to let me know.

Looking forward to hearing from you.

Best regards,
Daniel

Thanks for the point towards Channels. I think that’s close to what I need, but maybe I was not clear enough about our environment. I only want to deploy certain packages (services) at a time, not all of them. I don’t see a way to do this with Channels.

Hi @Smayer,

Thanks for getting back! I believe it somewhat depends on how your project is designed. Generally by default Octopus expects the entire project to be deployed with each deployment. Partial deployments can be a complicated matter and I was under the impression we covered it in more detail in our Channels docs.

However, it looks like we have since split out the Branching section into its own documentation page.

We have a section in the above documentation about partial releases which should help you out here.

If you are still stuck, let me know and I can try and work up some examples and help you get this configured. :slight_smile:

Best regards,
Daniel

Thanks for the additional link. I think “Octopus doesn’t care about branches. It cares about NuGet packages.” really helped me wrap my mind around things. I’ve changed each of my services to be it’s own project. I think the only complication this adds is the auto deploy. How do I tell it to autodeploy only if that project is what it is in my environment?

For example: Service A from Branch 1 goes through some environments. Then Service A from Branch 2 gets deployed to dev. How do I make sure that only the Branch 2 package gets deployed to dev and not Branch 1?

Hi @Smayer,

Sorry for the delay in getting back to you here. I may be misinterpreting your needs here wrong but it sounds like the Channel Version Range feature is what you need to do this.

When you configure a Channel, you can design a version range and apply it to a package step. This is a way of telling Octopus which packages you would like to be used for each package step when creating a release to that Channel.

An example screenshot from our documentation.

We have a section on Version Rules which explains this in some detail.

Let me know if this is not exactly what you are after here. And sorry again for the delay.

Looking forward to hearing from you.

Best regards,
Daniel

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