Still very rough, but I have the DSL compiling and looking at making file copy work. This is more than anything an exercise in building a framework that uses the same structure as the MassTransit Sagas.
public class TestDeployment :
Deployment<TestDeployment>
{
public static Part Web { get; set; }
public static Part Db { get; set; }
public static Part Service { get; set; }
//dropkick r:role(web,db,service | full)
static TestDeployment()
{
Define(() =>
{
During(Web, (p) =>
{
p.OnServer("WebServer")
.IisSite("Apps")
.VirtualDirectory("dashboard")
.Verify()
.CreateIfItDoesntExist();
p.OnServer("SrvTopeka19")
.Msmq()
.PrivateQueueNamed("mt_subscriptions")
.CreateIfItDoesntExist();
p.CopyFrom(@".\code_drop\dashboard\**\*.*").To(@"\\webserver\apps\dashboard\")
.And((f) =>
{
f.WebConfig
.ReplaceIdentityTokensWithPrompt()
.EncryptIdentity();
});
});
During(Db, (p) =>
{
p.OnServer("sql")
.SqlInstance(".")
.Database("dashboard")
.Verify()
.BackupWithLightspeedTo(@"\\sql\\backsups\")
.RunTarantinoOn(@".\code_drop\dashboard\sql");
});
During(Service, (p) =>
{
p.OnServer("WebServer")
.WinService("dashboard service")
.Verify()
.Do(() => //auto-stop
{
p.CopyFrom(@".\code_drop\dashboard").To(@"\\webserver\apps\dashboard-service")
.And((f) =>
{
f.AppConfig
.ReplaceIdentityTokensWithPrompt()
.EncryptIdentity();
});
}); //auto-start
});
});
}
}