Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var bdc = new BuildDefinitionCriteria
            {
                ServerAddress       = Settings.Default.ServerAddress,
                BuildDefinitionName = Settings.Default.BuildDefinitionName,
                TeamProjectName     = Settings.Default.TeamProjectName
            };
            var checkInterval = TimeSpan.FromSeconds(Settings.Default.CheckInterval);
            var rc            = HostFactory.Run(x =>
            {
                x.Service <BuildLightsService>(s =>
                {
                    s.ConstructUsing(name => new BuildLightsService(bdc, checkInterval));
                    s.WhenStarted(tc => tc.Start());
                    s.WhenStopped(tc => tc.Stop());
                });
                x.RunAsLocalSystem();

                x.SetDescription("TFS Build Status Fetch Service");
                x.SetDisplayName("TFSBuildStatusFetchService");
                x.SetServiceName("TFSBuildStatusFetchService");
            });

            var exitCode = (int)Convert.ChangeType(rc, rc.GetTypeCode());

            Environment.ExitCode = exitCode;
        }
Ejemplo n.º 2
0
 public BuildLightsService(BuildDefinitionCriteria buildDefinitionCriteria, TimeSpan interval)
 {
     _buildDefinitionCriteria = buildDefinitionCriteria;
     _interval = interval;
 }