CakeBoss is the DevOpps tool for the C# masochist that knows Chef and Puppet are better but chooses something different because they don't like being told they can't write their scripts in C#
- Agent Events
- Agent API
- Client Referencing
- API Usage Machine1
- API Usage Machine2
- Scheduled Tasks
- Addins
- Example
- License
- Share the love
CakeBoss.Agent is a windows service that subscribes to the following events, executing the corresponding Cake-Build task when the event is triggered. The agent can even poll AWS instance meta-data every 5 seconds to trigger the Termination event.
- Start Service
- Stop Service
- Startup Server
- Shutdown Server
- Terminate Server
Task("Start")
.Description("Service Start.")
.Does(() =>
{
Information("---Configure the agent---");
ConfigureAgent(new AgentSettings()
{
Port = 8888,
EnableTerminationCheck = true,
EnableAPI = true
}.AddUser("Admin", "Password1"));
});
Task("Stop")
.Description("Service Stop.")
.Does(() =>
{
});
Task("Startup")
.Description("Server Startup.")
.Does(() =>
{
});
Task("Shutdown")
.Description("Server Shutdown.")
.Does(() =>
{
});
Task("Terminate")
.Description("AWS Instance Termination.")
.Does(() =>
{
});
A Nancy based api enables remote calls from the "Cake.CakeBoss" nuget package, allowing a central machine to execute tasks on individual nodes. Should go without saying but please do NOT enabled the api on a public machine!
Cake.CakeBoss is available as a nuget package from the package manager console:
Install-Package Cake.CakeBoss
or directly in your build script via a cake addin:
#addin "Cake.CakeBoss"
#addin "Cake.CakeBoss"
Task("Deploy")
.Description("The deployment process on Machine1")
.Does(() =>
{
Information("---Call the agent API on another machine---");
RunRemoteTarget("Deploy", new RemoteSettings()
{
Username = "Admin",
Password = "Password1",
Host = "Machine2"
Port = 8888
});
});
Task("Start")
.Description("Configures the API on Machine2")
.Does(() =>
{
Information("---Configure the agent---");
ConfigureAgent(new AgentSettings()
{
Port = 8888,
EnableTerminationCheck = false,
EnableAPI = true
}.AddUser("Admin", "Password1"));
});
Task("Deploy")
.Description("Remote target on machine2")
.Does(() =>
{
Information("---This would execute on machine2 from the script on machine1---");
});
CakeBoss uses FluentScheduler to enable scheduled tasks, please consult their documentation for the fluent interface.
Task("Start")
.Description("Service Start.")
.Does(() =>
{
Information("---Add scheduled tasks---");
//Every two hours
ScheduleTask("Timed-Critical-Task")
.ToRunNow().AndEvery(2).Hours();
//15 minute delay
ScheduleTask("Timed-Critical-Task")
.ToRunOnceIn(15).Minutes();
//Every morning
ScheduleTask("Timed-Critical-Task")
.ToRunEvery(1).Days().At(8, 30);
Information("---Configure the agent---");
ConfigureAgent(new AgentSettings()
{
EnableScheduledTasks = true
});
});
Task("Timed-Critical-Task")
.Description("A task that needs to run at a particular time")
.Does(() =>
{
Information("---This would execute at the scheduled times---");
});
Since CakeBoss is effectively just a different host for the Cake engine so you get access to all of its addins in your tasks:
- Cake.AWS.CloudFront
- Cake.AWS.EC2
- Cake.AWS.ElasticLoadBalancing
- Cake.AWS.Route53
- Cake.AWS.S3
- Cake.IIS
- Cake.Powershell
- Cake.Services
- Cake.Topshelf
- Cake.WebDeploy
A complete Cake example can be found here
Copyright (c) 2015 - 2016 Phillip Sharpe
CakeBoss is provided as-is under the MIT license. For more information see LICENSE.
If this project helps you in anyway then please ⭐ the repository.