We are using Bamboo as our continuous integration Build Server deploying to multiple environments. I am in the process of integrating SQL code deployment using Red Gate SQL Compare and Data Compare through Bamboo NANT scripts. Our TEST environment is code from the "TEST" branch of our repos and the STAGE environment is code from the "default" branch of our repos.
Our SQL and code base are separated into individual Mercurial repos: (Project_SQL) and (Project). The way we commit to each repo is different. In the Project_SQL repo, development is linear: each developer branches off of the TEST branch, creates a dev branch (Branch_1) and works on their changes, commits to the dev branch, and merges BACK into the TEST branch. We only move from the head of TEST to the default branch using the most recent tested and working tip of the TEST branch. Example: If 0, 1, 2, 3 are commits and 0, 1, and 3 are tested and passing. Only 0 and 1 would be in default. In the Project repo, the developer branches of the last tagged version from default that was pushed to Production and creates a dev branch (Branch_2), works on their changes, commits to the dev branch, and merges their changes into TEST. The specific dev branches that are passing in the TEST environment are then merged into default.
The requirement is that at the Bamboo polling interval if there are code commits (Project), then the SQL repo should be updated (Project_SQL) and any SQL changes deployed before the code is compiled and tests are executed. If at the polling interval there are only SQL changes, then the SQL is deployed and the tests in the code are executed as well.
With the following process and requirements in place, my reading has suggested that we could use the SQL repo as a subrepository of the code. Or we could have separate plans with dependencies set within Bamboo.
What is the recommended method or is there a better way?