I'm working on a CI and Auto Deploy configuration using TeamCity. The projects are .NET, using SVN for source control and SQL Server.
I'd like to know if and how it is posible to auto deploy sql scripts within my solution.
Our solution structure typically looks like this:
> 3.0 Scripts
* 01 - UpdateUserTable.sql
* 02 - UpdateRoleTable.sql
> 3.1 Scripts
* 01 - CreateJobTable.sql
* 02 - InsertJobTypes.sql
* 03 - AndSoOn.sql
I am still relatively new to TeamCity, so I'm not sure which way I should go about achieving my goal. My current line of thinking is as follows:
1) Get TeamCity trigger a build when a *.sql file is added to the solution. I stress added as I want this to be the rule that distiguishes between using the .sql file or not. (Is this what I would use artifacts for?)
2) Having triggered the build, compile the added .sql files into a single file and... go to step 3
2) For each *.sql file added, ordered alphabetically... go to step 3
3) Execute the sql file(s) on the sql server. Not sure how to do this yet. Perhaps using something like this: