

TEAMCITY DEPLOYMENT HOW TO
With regards to how to perform the deployment there are many options, I have used WebDeploy for ASP.Net applications and MSI packages executed by Remote Powershell scripts for Windows Services, but other options are also available depending on the technology you have.

TEAMCITY DEPLOYMENT CODE
Setting the ApiKey value at your Root project will allow it to be inherited by all other projects.It's a very broad question, but I will share the approaches I have used in a couple of scenarios:ġ) To deploy when a code checkin is performed, I have setup a build configuration that does the deployment, added the build configuration that does the compiling & packaging as a snapshot and artefact dependency which is then triggered with a Finish Build Trigger Ģ) To deploy at a given time of the day but only when new code has been checked in, I have setup a build configuration as above but triggered with a Schedule Trigger ensuring to select the dependent build in the Build Changes section. "EnvironmentName": "%env.Stackify_Environment%"Īny parameter can be injected into the scripts above using the %parameter.name% syntax. Paste the script below in the custom script content: curl -X POST Select "Command Line" as your Runner Type and choose to run a custom command. Invoke-WebRequest -Uri $post -Method POST -ContentType "application/json" -Headers $headers -Body $body If ($action -eq "start" -or $action -eq "complete") $bodyObj = Version=$version AppName=$app EnvironmentName=$env } $post = $hostApi.TrimEnd('/') + '/api/v1/deployments/' + $action

You can overwrite any preset parameters by passing in a Script argumentĪdd the script below to the Powershell script content. You will need to specify the Action type for you Deployment Request (Start, Complete, or Cancel) as well. Enter the script below into the Source Code Content and execute from an external file. Select "Powershell" for the Runner Type and we will run the script from Source Code. To see the generic examples for Bash and Powershell reference our API Code Samples guide. Add a Build Stepįrom your build configuration where you would like to notify Retrace of your Deployment, for example after a successful deployment, add a build step.įor the Runner Type choose Powershell or Command Line depending on the capabilities for your build agent. Instead of using our plugin, you can also manually add a build step in TeamCity.

Note: You will see some default values already filled in for some of the parameters. Choose "Stackify Retrace Deployment Recorder" from the dropdown.Navigate to Build Steps > Click Add build step.When viewing a build click "Edit Configuration Settings".You can view the plugin on Jetbrain's site here: Stackify Retrace Deployment Recorder Using the TeamCity Plugin
TEAMCITY DEPLOYMENT LICENSE
This should be enough for most projects, but if you need more, you can purchase an Enterprise license or additional build agents. This will allow you to pass in TeamCity Environment variables with ease when notifying Retrace. TeamCity Professional is free even for commercial use and allows you to use up to 100 configurations for your builds and run up to 3 builds in parallel. With the Stackify Retrace Deployment Recorder plugin for TeamCity you can notify Retrace of a deployment with a custom build step.
