Esempio n. 1
0
 protected override void RegisterBuildEvents(TeamCityBuildMonitor buildMonitor, int blinkInterval)
 {
     buildMonitor.BuildChecked += (sender, eventArgs) => BuildLight.Blink();
     buildMonitor.BuildPaused += (sender, eventArgs) => BuildLight.BlinkThenRevert(LightColour.Yellow, blinkInterval);
     buildMonitor.BuildSkipped += (sender, eventArgs) => BuildLight.BlinkThenRevert(LightColour.Purple, blinkInterval);
     buildMonitor.BuildSuccess += (sender, eventArgs) => BuildLight.BlinkThenRevert(LightColour.Green, blinkInterval);
     buildMonitor.BuildFail += (sender, eventArgs) => BuildLight.BlinkThenRevert(LightColour.Red, blinkInterval);
     buildMonitor.BuildUnknown += (sender, eventArgs) => BuildLight.BlinkThenRevert(LightColour.Yellow, blinkInterval);
 }
Esempio n. 2
0
        public override int Run(string[] remainingArguments)
        {
            BuildLight.TurnOffLights();
            AppDomain.CurrentDomain.ProcessExit += (sender, eventArgs) => BuildLight.TurnOffLights();

            BuildLight.TestLights();
            BuildLight.Disco(2);
            BuildLight.TurnOffLights();
            TeamCityBuildMonitor buildMonitor = null;
            try
            {
                var lies = new List<string>(_buildLies.ToLowerInvariant().Split(';'));
                ITeamCityApi api = new TeamCityApi(_serverUrl);
                buildMonitor = new TeamCityBuildMonitor(api, _specificProject, _failOnFirstFailed, lies, _pollInterval, _buildTypeIds);
                const int blinkInterval = 30;
                buildMonitor.CheckFailed += (sender, eventArgs) =>
                {
                    BuildLight.TurnOnFailLight();
                    Console.WriteLine(DateTime.Now.ToShortTimeString() + " Failed");
                };
                RegisterBuildEvents(buildMonitor, blinkInterval);
                buildMonitor.CheckSuccessfull += (sender, eventArgs) =>
                {
                    BuildLight.TurnOnSuccessLight();
                    Console.WriteLine(DateTime.Now.ToShortTimeString() + " Passed");
                };
                buildMonitor.ServerCheckException += (sender, eventArgs) => Console.WriteLine(DateTime.Now.ToShortTimeString() + " Server unavailable");
                buildMonitor.Start();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

            Console.ReadKey();

            if (buildMonitor != null) buildMonitor.Stop();
            BuildLight.TurnOffLights();
            return 0;
        }
Esempio n. 3
0
 protected override void RegisterBuildEvents(TeamCityBuildMonitor buildMonitor, int blinkInterval)
 {
 }
Esempio n. 4
0
 protected abstract void RegisterBuildEvents(TeamCityBuildMonitor buildMonitor, int blinkInterval);