Question

In my build workflow I change the assembly version information in AssemblyInfo.cs. How can I check-in my changes at the end of the build process only if build was successful?

Was it helpful?

Solution

  1. Create new build configuration in the TeamCity Project.
  2. In the new build configuration go to Build Steps and add Build Feature and select AssemblyInfo Patcher.

    AssemblyInfo Patcher build feature allows to set a build number to an assembly automatically, without having to patch AssemblyInfo.cs files manually. When adding this build feature you need only to specify version format.

  3. Add another Build Step that will commits pending changes in the current workspace - Checkin Command.

  4. In your Main Project go to "Build Triggers"

"Build triggers are used to add builds to the queue either when an event occurs (like a VCS check-in) or periodically with some configurable interval."

In Build Triggering add new trigger - "Finish Build Trigger"

Finished Build Trigger will add a build to the queue after a build finishes in the selected configuration.

In Build configuration select the build Project created previously (Step 1) and don't forget to select the check box Trigger after successful build only.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top