Thanks for getting in touch with Octopus!
Based on your scenario, I think you can achieve deploying Package A to any machines in the environment applicable to Channel A and deploying Package B to any machines in the environment Channel B using a variable which is scoped to each Channel (https://octopus.com/docs/deployment-process/channels).
For this, you can continue to use your one project - I’ve created one called Channel-Based-Packages
Once you have set-up your Channels to include the relevant environments, I added a variable called WebsitePackageID
I have scoped
PackageA to Channel A, and scoped
PackageB to Channel B.
I then added a Package Step to the Deployment process and bound the variable WebsitePackageID to the PackageID property:
Next up, when creating the release for Channel A, Octopus already knows which package you need:
When creating the release for Channel B, Octopus selects PackageB correctly:
From the Project Overview screen, Octopus knows which Environments are associated with each Channel:
Channel A can only deploy to
Channel B can only deploy to
0.0.1 to Channel A shows PackageA being chosen:
Finally deploying release
0.0.2 to Channel B shows PackageB being chosen:
Just a couple of notes on your scenario in general:
- If the application packages you are deploying are genuinely different, e.g unrelated websites, you could have 2 projects with different names. If you rely on a common name for the website and backups etc, you can create a common Library Variable Set (https://octopus.com/docs/projects/variables/library-variable-sets) and add to each project and use that in your projects instead of using the built-in one for the project name.
- If you didn’t want to use variables at all, you could have each step in a single project and hard-code the package names in each step, and scope the deployment step to each channel (see screenshot below). This isn’t my preferred option, but letting you know about it for complete transparency on options available.
Choosing a Channel condition on a step
Hope that helps!