We are seeking to improve several aspects of our SDLC. What we have right now is the following, and these are fairly new-ish and light years beyond what we had a couple years ago:
- Code: we are predominantly a .Net shop. We develop mostly web apps (MVC/SQL Server). But we also have some batch console apps.
- SCM: Git and Enterprise GitHub. Most work is done directly in the master branch (queue boo-hiss) but we recognize the need to move to a branching model. We are going to implement some flavor of Vincent Driessen's model.
- CI server: Team City. Our immediate need a year or two ago was to get deployment automation set up to avoid hazard-laden manual scripts. We now use TeamCity to kick off deployment scripts via PowerShell. (It uses msbuild to simply build targeted configs -- standard is Debug and Release; we've set up Dev, QA, and Prod configs in each solution -- defined in the Visual Studio solutions.) Sadly, we have yet to actually use TeamCity for it's intended purpose, which is continuous integration. For that, we need to implement TDD. The deployment automation pulls from the master branch for each repository.
- Environments: we have 3 environments, each with dedicated web, batch, and database servers. We call them Dev, QA, and Prod. Dev is our testing environment. QA is for end users to test. Prod is prod. Our deployment automation, in general, pushes each app to each environment one time. It cannot currently handle pushing the same app to multiple places in a single environment.
Note that we are starting to have situations where we need to do parallel development: one feature is being worked on in one branch; another in another branch; and a hotfix in another. Obviously doing everything in master is unacceptable.
Here is where I'd like to go:
- Begin a branching model in Git.
- Move the deployment automation out of Team City and into a custom, robust deployment tool.
- Implement TDD.
- Use TeamCity for its intended purpose, continuous integration.
Those are the high level goals, and I have rough ideas on how to start doing this (especially with the deployment automation). However, I have some rather large outstanding issues that are frustrating my (woo-ha-ha) master plan. So here are the items I'd love input from SO community on:
- When you do CI and kick off automated tests, what branch(es) do you do this against? I'm thinking that, in theory, you don't want "broken" code in your "develop" and (obviously) "master" branches. Do you kick of CI against "develop" or all branches?
- Do you merge into master before or after you move your code to prod? Put another way, do you push to prod from develop or master?
- Sometimes we will need to test (at least in QA, maybe in Dev) parallel changes, like a bugfix and a feature. Do you literally set up multiple test websites (e.g. myappqa1.blah.com and myappqa2.blah.com, etc.)? How do these multiple environments play into your deployment automation?
- Just of out of curiosity, do you do nightly builds -- if so, against what branch? Do you deploy this nightly build anywhere?
- How do you package your apps (i.e. store releases)? Right now, we use TeamCity and PowerShell to run msbuild against config's defined in the VS. It will put all environment builds into a zip file. This is stored as an artifact of the TeamCity build. Here is a visual of what I'm talking about:
Then another script will pick the right environments out of the zip file and deploy. Should we store the release package in Team City or Git (using the "release" feature) somehow? - Related, with your deployment automation: do you deploy a previously packaged/built app, or do you build and deploy all in one fell swoop?
Your feedback much appreciated!
Thanks Tom