Cake build addin for managing Topshelf based windows services.
Switch branches/tags
Nothing to show
Clone or download
#13 Compare This branch is 36 commits ahead of RagingKore:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build/scripts
nuspec Update to Cake.Core v0.29 Aug 12, 2018
src
test
.gitattributes
.gitignore
LICENSE
README.md
ReleaseNotes.md
appveyor.yml
build-skip-restore.bat
build-skip-test.bat
build.bat
build.cake
build.ps1
cake.config

README.md

Cake.Topshelf

Cake Build addin for managing Topshelf windows services

Build status

cakebuild.net

Join the chat at https://gitter.im/cake-build/cake

Table of contents

  1. Implemented functionality
  2. Referencing
  3. Usage
  4. Example
  5. Plays well with
  6. License
  7. Share the love

Implemented functionality

  • Install
  • Uninstall
  • Start
  • Stop

Referencing

NuGet Version

Cake.Topshelf is available as a nuget package from the package manager console:

Install-Package Cake.Topshelf

or directly in your build script via a cake addin directive:

#addin "Cake.Topshelf"

Usage

#addin "Cake.Topshelf"

Task("Install")
    .Description("Installs a Topshelf service")
    .Does(() =>
{
    InstallTopshelf("C:/Services/example.exe", new TopshelfSettings()
    {
        Username = "Admin",
        Password = "Password1",

        Instance = "Example",
        Autostart = true,
        Delayed = true
    });
});

Task("Install-Fluent")
    .Description("Installs a Topshelf service using the fluent interface")
    .Does(() =>
{
    InstallTopshelf("C:/Services/example.exe", new TopshelfSettings()
        .UseUsername("Admin")
        .UsePassword("Password1")
        .SetInstance("Example")
        .SetAutostart()
        .SetDelayed()
    );
});

Task("Uninstall")
    .Description("Uninstalls a Topshelf service")
    .Does(() =>
{
    UninstallTopshelf("C:/Services/example.exe");
});



Task("Start")
    .Description("Starts a Topshelf service")
    .Does(() =>
{
    StartTopshelf("C:/Services/example.exe", "Instance Name");
});

Task("Stop")
    .Description("Stops a Topshelf service")
    .Does(() =>
{
    StopTopshelf("C:/Services/example.exe", "Instance Name");
});

RunTarget("Install");

Example

A complete Cake example can be found here.

TroubleShooting

  • Please be aware of the breaking changes that occurred with the release of Cake v0.22.0, you will need to upgrade Cake in order to use Cake.Topshelf v0.2.0 or above.

Plays well with

If your looking to manage standard windows services or just looking for more related aliases its worth checking out Cake.Services.

If your looking for a way to trigger cake tasks based on windows events or at scheduled intervals then check out CakeBoss.

License

Copyright (c) 2015 - 2016 Sergio Silveira, Phillip Sharpe

Cake.Topshelf is provided as-is under the MIT license. For more information see LICENSE.

Share the love

If this project helps you in anyway then please ⭐️ the repository.