I have query which I thought someone else may have encountered and can help with. We follow GitFlow branching model and have separate Dev and Master builds. Nuget package output from these Dev and Master build is uploaded to separate Nuget repositories respectively. During deployment we deploy nuget package from Dev gallery to our Dev environment using CD pipeline. For rest of the environment we deploy packages from Master nuget gallery.
In Octopus how can I create a release for Dev deployment pointing to Dev Nuget repo and one deploying to Test or any other environment pointing to Master Nuget gallery. One way of doing this is to use variable in Octopus pointing to Dev gallery for Dev environment and Master gallery for other environments. There is one limitation with this approach though that I cannot scope my nuget gallery URL to Dev environment as this prevents release creation and retrieving package information. As a result I have keep my Dev Nuget gallery variably open scoped and scope my Master gallery variable Test, UAT and Prod environment. This can be a issue in case a new environment is added but variable is not scoped. There are chances package from Dev nuget gallery may get deployed to this environment.
Also, not all Master releases will be deployed. Our CI tool creates new release whenever there is a change in source code or in dependent nuget package. This creates lot of Master build but these are not continuously deployed to target environment. At given time latest Master release is picked and deployed to Test and environment and promoted further. I would like to preserve Nuget packages for the deployed referenced in Master release which was deployed. I cannot use Octopus built in package manager due to limitations placed by central Octopus team so I need to somehow preserve these packages in our Master nuget gallery as there is purge process which deletes packages after couple of months.
Any help in this regard will be highly appreciated!