By Richard Simes / @rdsimes
This should be easy?
All we need is a git push
There are lots of really cool deploy tools out there.
Most arent .NET specific.
From: richard.simes@trademe.co.nz To: DevTeam@trademe.co.nz Subject: Reminder - run the unit tests ---------------------------------------------------- Hey guys, Just a reminder.... Please remember to run the unit tests before you deploy. For those of you this isn't already obvious to, please dont deploy anything if they fail? Cheers, Richard
From: richard.simes@trademe.co.nz To: DevTeam@trademe.co.nz Subject: Reminder - update from VSS before deploying ---------------------------------------------------- Hey guys, Just a reminder.... Please remember to get the latest from VSS before you deploy anything. Cheers, Richard
Not a bad option. Probably.
Where is the documentation?
Define(settings =>
{
DeploymentStepsFor(Db,
s =>
{
s.RoundhousE()
.ForEnvironment(settings.Environment)
.OnDatabase(settings.DbName)
.WithScriptsFolder(settings.DbSqlFilesPath)
.WithDatabaseRecoveryMode(settings.DbRecovery)
.WithRestorePath(settings.DbRestorePath)
.WithRepositoryPath("somewhereoutthere")
.WithVersionFile("_BuildInfo.xml")
.WithRoundhousEMode(settings.RoundhousEMode)
;
});
DeploymentStepsFor(Web,
s =>
{
s.CopyDirectory("..\_PublishedWebSites\WebAppName").To("{{WebsitePath}}").DeleteDestinationBeforeDeploying();
s.CopyFile(@"..\environment.files\{{Environment}}\{{Environment}}.web.config").ToDirectory(@"{{WebsitePath}}").RenameTo(@"web.config");
s.Security(securityOptions =>
{
securityOptions.ForPath(settings.WebsitePath, fileSecurityConfig => fileSecurityConfig.GrantRead(settings.WebUserName));
securityOptions.ForPath(Path.Combine(settings.WebsitePath, "logs"), fs => fs.GrantReadWrite(settings.WebUserName));
securityOptions.ForPath(@"~\C$\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files", fs => fs.GrantReadWrite(settings.WebUserName));
if (Directory.Exists(@"~\C$\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files"))
{
securityOptions.ForPath(@"~\C$\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files", fs => fs.GrantReadWrite(settings.WebUserName));
}
});
});
Dropkick example
Maybe not such a bad option
It can be a lot of work
Please open source it
Continuous Integration - Team City
Source control - mercurial
Nuget, NUnit, JS/css minification
Take a backup
Copy the build in parallel, to all servers
Copy to a temporary location
Incremental changes?
We have ~20 database servers.
Get a list of updated stored procs & UDFs
Look up all their targets (some may have multiple)
alter table auction alter column auctionid bigint; /* Hmmm? */
Deploy all the time
Smaller deploys
Sessions will be lost
OK: SQL Server Mode
Better: Don't use sessions
You'll find other things that break
Deploy often and fix quickly
When things go wrong, recover fast
Keep the previous version on every server
Monitor everything
Rollback in seconds, not minutes
Yep, Database rollback too...
but you probably need to test that