title: TeamCity Build Steps Setup
body: <p>I'm trying to figure out how to configure TeamCity build steps to accomplish the following tasks:</p>
  
  <ol>
  <li>Call a console app that merges the dev branch to the test branch (in
  TFS) and modifies some of the files manually in the test branch that
  are used for the projects configurations. This process works perfect
  and has been tested. Also note, this step <strong>does not</strong> check in the
  merged files or modified files to the test branch.</li>
  <li>This build step will kick off the actual solution build for the test
  branch. (This is C#.NET, but I don't think that is significant)</li>
  <li>This build step handles the database migration for any SQL scripts
  added. (This step has also been tested and works)</li>
  <li>This step calls another console app. This step will run even if a previous steps fail.     If the build has been successful it will check in the pending changes from step 1, and do the deployment of the build. If the build has failed in a previous step, it will undo the pending changes from step 1.</li>
  </ol>
  
  <p>That seems simple enough to do, but I the interaction between steps 1 and 2 is what I don't know how to do. If I use server-side checkout for step 2 it will pull the source from the server and not use my changes in step 1. If I user agent-side checkout, my understanding is that it will create a new workspace and pull the source from the server, again not using my changes in step 1. </p>
  
  <p>Is there a way I can make step 2 build with the pending changes created in step 1? The only other option I can think of is to check in the changes after step 1 and rollback the changeset in step 4 if the build fails. In that case though, how would step 4 know the changeset to rollback?</p>
  
  <hr>
  
  <p>Also I have one smaller question, how can I pass the success of the build as a parameter to step 4? I looked through the built-in parameters but I didn't one for build failure/success?</p>
  
  <p>Thanks!</p>