Hi,
I set up teamcity to use psake using the psake.cmd
Here is my psake.cmd:
@echo off
if '%1'=='/?' goto help
if '%1'=='-help' goto help
if '%1'=='-h' goto help
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\Scripts\Build\psake.ps1' %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }"
goto :eof
:help
powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\Scripts\Build\psake.ps1' -help"
my build tasks are described as follow :
task CompileCommon {
exec { msbuild "$sln_file_common" /p:Configuration=$configuration }
}
task CompileClient {
exec { msbuild "$sln_file_client" /p:Configuration=$configuration }
}
task CompileServer {
exec { msbuild "$sln_file_server" /p:Configuration=$configuration }
}
task All -depends Clean, CompileCommon, CompileClient, CompileServer {
}
In TeamCity I have a Command line build step
Run : Executable with parameter
Command executable : psake.cmd
Command parameters : -t All
This was not failing the build, I added the following line in the psake.ps1 file as described in the github wiki
...
$psake.use_exit_on_error = $true
invoke-psake $buildFile $taskList $framework $docs $parameters $properties $initialization $nologo
This still doesn't fail the build.
There must be a simpler way to make psake "just work" on teamcity. What am I missing?