Using Cake tasks to build steps
Using Task Runner Explorer to run build tasks written in Cake scripts is easier and more convenient. This is usually done through Cake Extension for Visual Studio or by directly invoking the Cake bootstrapper file. However, there is an alternative that is more efficient, which is to run the Cake build script using the TeamCity CI tool.
The TeamCity build steps can be used to execute Cake scripts as part of the build steps execution processes. Let's create a build step that executes the Cake script for the LoanApplication
project by following these steps:
- Click on
Add Build Step
to open aNew Build Step
window. - In the
Runner type
, selectPowerShell
, since the Cake bootstrapper file will be invoked by PowerShell. - Give the build step a descriptive name in the text field.
- In the
Script
option, selectFile
. This is because it is a.ps1
file that will be invoked and not a direct PowerShell script. - To select the
Script file
, click on the tree icon; this will load the...