Deploy DB project with Team Build 2010


I work in a project and I try to automate everything so I just need to automate the deployment of the project including the DB with the CI (continuous integration) to QA machine or Testing environment so the scenario start with the developer try to check-in his code so the team build start build the project and when he succeeded it will deploy the website to the Testing web server and deploy the DB to the Testing DB server, to keep my article simple I will just describe the part of the DB only so I will separate it from the rest of the project

  1. Create DB project
    Edit DB properties

    Edit DB properties

  1. Edit the properties of the DB project in the deployment tab so it will deploy script and create the DB
    Edit deploy tab

    Edit deploy tab

  2. Check-out any process template from the process template folder
    Check-out process

    Check-out process

  3. Copy the file an rename it to the name you want
  4. Add the file to the source control and check-in it after rename it
    Add the process to the source control

    Add the process to the source control

  5. open the new file
  6. delete all steps, arguments and variables
    Delete any items

    Delete any items

  7. Add sequence task and a MS Build task inside the sequence from the tool box
    Add Sequence and MS build tasks

    Add Sequence and MS build tasks

  8. start adding the following argument as the following image
    Arguments

    Arguments

    Arguments 2

    Arguments 2

    Set Configuration

    Set Configuration

     

  9. Save the file
  10. Check-in the file
  11. to keep my article simple I will do this step manually, copy your DB project folder to the Team Build machine folder
  12. start create new build definition from the new process file and give this build definition the need parameter and one of them is the path of the DB project on the Team build server
    New build definition

    New build definition

     

     

    Build use the create process

    Build use the create process

    Put the build parameters

    Put the build parameters

     

  13. Queue and build using the created build definition
  14. check your DB.
  15. Done.

You can download the process template files and the parameters value by clicking here

Share This: