-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathProgram.cs
More file actions
39 lines (36 loc) · 1009 Bytes
/
Program.cs
File metadata and controls
39 lines (36 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//------------------------------------------------------------------------------
// <copyright company="LeanKit Inc.">
// Copyright (c) LeanKit Inc. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using Topshelf;
namespace IntegrationService
{
public class Program
{
public static void Main()
{
HostFactory.Run(x =>
{
var configOnly = false;
x.AddCommandLineSwitch("config", p => configOnly = true);
x.Service<IntegrationService>(s =>
{
s.ConstructUsing(name => new IntegrationService());
s.WhenStarted(tc =>
{
if (configOnly)
tc.StartConfigService();
else
tc.Start();
});
s.WhenStopped(tc => tc.Stop());
});
x.RunAsLocalSystem();
x.SetDescription("LeanKit Integration Service");
x.SetDisplayName("LeanKit Integration Service");
x.SetServiceName("LeanKit-Integration-Service");
});
}
}
}