Thanks Vanessa,
Let me attach some screenshots so that I can more easily explain what I am doing. It turns out that selecting that second step does actually cause both to be built; but this is not intuitive from the way the feature is shown on the screen. Even though my OP’s issue seems to be solved, here is what I am doing in case it is useful for your team in figuring out workflow, or for another user trying to set up the same scenario:
For technologies I am using TeamCity 8.x and Octopus 2.6. I have a solution with multiple projects, each of which needs to be packaged and deployed separately as both Debug and Release builds. For discussion let’s assume I have projects named A, B, and C that need to have both Debug and Release builds. My goal is to have Octopus auto-generate releases of these builds so that I can push Debug builds for any combination of { A,B,C } to a developer staging environment, and push Release builds for any combination of { A,B,C } to a QA staging environment.
Originally I had two Build Configurations in TeamCity. The first was a Continuous Integration build of the solution which used Octopack to generate nupkg artifacts (6 in this case – 3 projects, 2 builds each). A second build configuration was triggered by this being completed, which used the “Octopus Deploy: Create Release” build step from the Octopus/TeamCity plugin to generate releases in Octopus. This mostly worked, but I do not want two build configurations in TeamCity.
In order to fix this I reconfigured TeamCity to match what is seen in the “teamcity_build_steps” screenshot. Here there are five build steps in a single build configuration:
- Build unit tests (unimportant for this discussion)
- Execute unit tests (unimportant for this discussion)
- Build the debug configuration of my projects, run octopack, and store the nupkg files in a specific directory
- Do the same as step #3 but in Release mode instead of Debug
- Push nuget packages from both directories to the Octopus nuget server
For information on how steps #3 and #4 are configured can be seen in the “build_configuration_with_octopack” screenshot. Mildly frustrating was figuring out that I had to use the OctoPackAppendToPackageId parameter to add ‘Debug’ and ‘Release’ to the nupkg name before the version, since adding it after breaks SemVer and causes errors to occur. This is counter to advice from this discussion, which I could not get to work: http://help.octopusdeploy.com/discussions/questions/1786
This TeamCity build step order allowed me to avoid complex solutions to artifact-lifetime issues seen in threads such as: http://help.octopusdeploy.com/discussions/problems/556
Once the packages are pushed to Octopus, I want to create releases automatically. I upgraded to 2.6 because of the new automation feature. Each of my projects is configured as seen in the “octopus_project_steps” screenshot. Here, each project has two build steps, one of which deploys the Debug build to the DEV environment, and one of which deploys the Release build to the QA environment. Since they target separate environments, this can be safely run against either environment without extraneous actions being taken. Great.
However, as seen on the right, it is unclear that the “Automatic Release Configuration” should be set to the second of these packages based on the upload order of the NuGet packages from TeamCity. After I posted my OP, I ran some tests and found that selecting the second of my build steps (Release) works, because in TeamCity I push the Debug packages before the Release packages during step #5.
Additionally, I was previously confused due to an issue where no release would be generated for two of the three projects. It turns out that projects A, B and C all need to have their Settings -> Release Versioning option set to “Use the version number from an included NuGet package” or else no release would be generated. This may be due to my use of default/unconfigured nupkg values right now, but I’m not certain.
Hopefully this workflow is useful to someone, and is informative to your process. If there is anything that I am doing here that is “wrong” as far as how Octopus is intended to be used, please let me know so that we can discuss.
Thanks in advance!