You'll need to setup an environment for Production in Octopus Deploy.
Assumptions:
- Your Production environment in Octopus is named Production
- You are using octo.exe in a Command Line build step in TeamCity to create and deploy the releases.
You can use the --deployto
option of octo.exe to specify an environment to deploy your newly created release to. Something like this:
octo create-release --server=http://your-octopus/api --project=Project.Website --version=%build.number% --packageVersion=%build.number% --deployto=Production
This command will:
- Create a release using your TeamCity build number as the version
- Use your TeamCity build number as the package version for all packages
- Deploy the release to the Production environment
TIP: Sometimes it takes a few seconds for TeamCity to get the artifacts published into it's NuGet feed. If your octo command tries to create a release using package versions that are not yet published the command (and build step) will fail. I build in a 30 second "sleep" in my script before running the octo.exe command to ensure that the build server has had time to publish the current version of the packages.