예제 #1
0
파일: Program.cs 프로젝트: ducas/TeamFlash
        static void Main()
        {
            var teamFlashConfig = LoadConfig();

            teamFlashConfig.ServerUrl = ReadConfig("TeamCity URL", teamFlashConfig.ServerUrl);
            teamFlashConfig.Username = ReadConfig("Username", teamFlashConfig.Username);
            var password = ReadConfig("Password", "");
            teamFlashConfig.BuildTypeIds = ReadConfig("Comma separated build type ids (eg, \"bt64,bt12\"), or * for all", teamFlashConfig.BuildTypeIds);

            SaveConfig(teamFlashConfig);

            Console.Clear();

            var buildTypeIds = teamFlashConfig.BuildTypeIds == "*"
                ? new string[0]
                : teamFlashConfig.BuildTypeIds.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToArray();

            #if __MonoCS__
            var buildLight = new Linux.BuildLight();
            #else
            var buildLight = new BuildLight();
            #endif

            buildLight.Off();

            while (!Console.KeyAvailable)
            {
                var lastBuildStatus = RetrieveBuildStatus(
                    teamFlashConfig.ServerUrl,
                    teamFlashConfig.Username,
                    password,
                    buildTypeIds);
                switch (lastBuildStatus)
                {
                    case BuildStatus.Unavailable:
                        buildLight.Off();
                        Console.WriteLine(DateTime.Now.ToShortTimeString() + " Server unavailable");
                        break;
                    case BuildStatus.Passed:
                        buildLight.Success();
                        Console.WriteLine(DateTime.Now.ToShortTimeString() + " Passed");
                        break;
                    case BuildStatus.Investigating:
                        buildLight.Warning();
                        Console.WriteLine(DateTime.Now.ToShortTimeString() + " Investigating");
                        break;
                    case BuildStatus.Failed:
                        buildLight.Fail();
                        Console.WriteLine(DateTime.Now.ToShortTimeString() + " Failed");
                        break;
                }

                Wait();
            }

            buildLight.Off();
        }
예제 #2
0
        static void Main()
        {
            Logger.VerboseEnabled = PromptForVerboseMode();

            var teamFlashConfig = LoadConfig();

            teamFlashConfig.ServerUrl = ReadConfig("TeamCity URL", teamFlashConfig.ServerUrl);
            teamFlashConfig.Username  = ReadConfig("Username", teamFlashConfig.Username);
            var password = ReadConfig("Password", "");

            teamFlashConfig.BuildTypeIds         = ReadConfig("Comma separated build type ids to INCLUDE (eg, \"bt64,bt12\"), or * for ALL", teamFlashConfig.BuildTypeIds);
            teamFlashConfig.BuildTypeIdsExcluded =
                ReadConfig("Comma separated build type ids to EXCLUDE (eg, \"bt64,bt12\"), or * for NONE",
                           teamFlashConfig.BuildTypeIdsExcluded);

            SaveConfig(teamFlashConfig);

            Console.Clear();

            var buildTypeIds         = ConvertBuildTypeIdsToArray(teamFlashConfig.BuildTypeIds);
            var buildTypeIdsExcluded = ConvertBuildTypeIdsToArray(teamFlashConfig.BuildTypeIdsExcluded);

#if __MonoCS__
            var buildLight = new Linux.BuildLight();
#else
            var buildLight = new BuildLight();
#endif

            buildLight.Off();

            while (!Console.KeyAvailable)
            {
                var lastBuildStatus = RetrieveBuildStatus(
                    teamFlashConfig.ServerUrl,
                    teamFlashConfig.Username,
                    password,
                    buildTypeIds,
                    buildTypeIdsExcluded);
                switch (lastBuildStatus)
                {
                case BuildStatus.Unavailable:
                    buildLight.Off();
                    Logger.WriteLine("Build status not available");
                    break;

                case BuildStatus.Passed:
                    buildLight.Success();
                    Logger.WriteLine("Passed");
                    break;

                case BuildStatus.Investigating:
                    buildLight.Warning();
                    Logger.WriteLine("Investigating");
                    break;

                case BuildStatus.Failed:
                    buildLight.Fail();
                    Logger.WriteLine("Failed");
                    break;
                }

                Wait();
            }

            buildLight.Off();
        }
예제 #3
0
        static void Main()
        {
            Logger.VerboseEnabled = PromptForVerboseMode();

            var teamFlashConfig = LoadConfig();

            teamFlashConfig.ServerUrl = ReadConfig("TeamCity URL", teamFlashConfig.ServerUrl);
            teamFlashConfig.Username = ReadConfig("Username", teamFlashConfig.Username);
            var password = ReadConfig("Password", "");
            teamFlashConfig.BuildTypeIds = ReadConfig("Comma separated build type ids to INCLUDE (eg, \"bt64,bt12\"), or * for ALL", teamFlashConfig.BuildTypeIds);
            teamFlashConfig.BuildTypeIdsExcluded =
                ReadConfig("Comma separated build type ids to EXCLUDE (eg, \"bt64,bt12\"), or * for NONE",
                    teamFlashConfig.BuildTypeIdsExcluded);

            SaveConfig(teamFlashConfig);

            Console.Clear();

            var buildTypeIds = ConvertBuildTypeIdsToArray(teamFlashConfig.BuildTypeIds);
            var buildTypeIdsExcluded = ConvertBuildTypeIdsToArray(teamFlashConfig.BuildTypeIdsExcluded);

            #if __MonoCS__
            var buildLight = new Linux.BuildLight();
            #else
            var buildLight = new BuildLight();
            #endif

            buildLight.Off();

            while (!Console.KeyAvailable)
            {
                var lastBuildStatus = RetrieveBuildStatus(
                    teamFlashConfig.ServerUrl,
                    teamFlashConfig.Username,
                    password,
                    buildTypeIds,
                    buildTypeIdsExcluded);
                switch (lastBuildStatus)
                {
                    case BuildStatus.Unavailable:
                        buildLight.Off();
                        Logger.WriteLine("Build status not available");
                        break;
                    case BuildStatus.Passed:
                        buildLight.Success();
                        Logger.WriteLine("Passed");
                        break;
                    case BuildStatus.Investigating:
                        buildLight.Warning();
                        Logger.WriteLine("Investigating");
                        break;
                    case BuildStatus.Failed:
                        buildLight.Fail();
                        Logger.WriteLine("Failed");
                        break;
                }

                Wait();
            }

            buildLight.Off();
        }