teamcityteamcity-8.0

How to prevent build steps running for personal builds


We have a build configuration in TeamCity with 3 build steps. Is there a way to prevent step 2 from running for personal builds such that normal VCS triggers executes steps 1, 2 and 3 - but only 1 and 3 are run for personal builds?

There is a variable BUILD_IS_PERSONAL set to true for personal builds, but it isn't defined if not: http://confluence.jetbrains.com/display/TCD8/Predefined+Build+Parameters

How are you meant to use the variable as whenever I use it in a build configuration script, it asks me to define the value manually?


Solution

  • I modified the configuration for the second step to be wrapped in this if statement:

    IF "%%BUILD_IS_PERSONAL%%"=="" (
    rem do stuff
    )
    

    The thing I had been missing was escaping the TeamCity variable syntax with an extra '%'.