Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Help me come up with a deployment strategy

So I have an ASP.NET MVC website I am developing and never had a decent deployment strategy so making changes, especialy database scheme ones can involve a lot of steps and time.

Here are the steps I am looking todo and would like suggestions on how to do it or tools (preferably free). Feel free to point out any missing steps or things I am doing wrong.

Edit: I will list tools I have used to solve each stage

  1. Check out all code from source control (perforce)
  2. Build debug and relese version. Release version needs different connection strings in web.config. (MSBUILD)
  3. Run all unit tests
  4. For each page (aspx) combine all referenced JS files and inline code into one file. Same with css
  5. Minify said JS and CSS files.
  6. Backup live database schema and data
  7. deploy database schema changes to live server
  8. upload all files that are new or have changed to the server.
  9. Backup all code and my source control depository to external drive and possibly online.

I have it lucky that my site won't have any visitors between 1am and 4pm so all this can be done without the need for staging servers etc?

I know my question is long but this would probably help a lot of people.

like image 907
ddd Avatar asked Aug 31 '09 22:08

ddd


1 Answers

MSBuild (or likely any other build technology) is probably your best bet for accomplishing all these tasks automatically.

You can use MSBuild to do 1 through 4 with no problems. We update our web configs with MSBuild using an XMLUpdate task, and we also run some awk scripts to augment some of our generated code using an Exec task.

For #5 and #6, you'd again probably want to use Exec to execute some script to get the backup files and run them against the production instances, however I'm not a SQL admin so I have no idea if that's the best way, or if there are already MSBuild tasks for this.

For actual file copying, there is the Copy task, and likely others, but you may need to resort to xcopy or a custom script.

Managing the build of your product is a big job, but it's the exact reason that technologies like MSBuild and Ant were created.

like image 131
womp Avatar answered Oct 30 '22 08:10

womp