예제 #1
0
        private static async Task Start(Options options)
        {
            _logger.Information("Starting LightHouse with the following properties:");
            _logger.Information($"Service: {options.Service}");
            _logger.Information($"Refresh interval: {options.RefreshInterval}");
            _logger.Information($"Brightness: {options.Brightness}");

            _logger.Information("Start sequence...");

            _signalLightController.Test();

            _logger.Information("Starting to watch build status...");

            var buildProviderSettings = new BuildProviderSettings
            {
                AccessToken = options.Token,
                Collection  = options.Collection,
                Instance    = options.Instance,
                ExcludedBuildDefinitionIds = options.ExcludeBuildDedfinitionIds.ToList(),
                TeamProjects = options.TeamProjects.ToList()
            };

            await _buildsWatcher.Watch(
                buildService : options.Service,
                buildProviderSettings : buildProviderSettings,
                refreshInterval : options.RefreshInterval,
                onRefreshAction : buildsStatus => ProcessBuildsStatus(buildsStatus, options.Brightness, options.EnableFlashing));
        }
예제 #2
0
        private async Task Start()
        {
            _logger.Information("Starting LightHouse with the following properties:");
            _logger.Information($"Service: {LighthouseSettings.Service}");
            _logger.Information($"Refresh interval: {LighthouseSettings.RefreshInterval}");
            _logger.Information($"Brightness: {LighthouseSettings.Brightness}");
            _logger.Information($"Flashing enabled: {LighthouseSettings.EnableFlashing}");

            _logger.Information("Start sequence...");

            _signalLightController.Test();

            _logger.Information("Starting to watch build status...");

            var teamProjects = LighthouseSettings.Projects
                               .Split(',')
                               .Select(p => p.TrimStart().TrimEnd())
                               .ToList();

            var excludedBuildDefinitionIds = LighthouseSettings.ExcludeBuildDefinitionIds != null
                ? LighthouseSettings
                                             .ExcludeBuildDefinitionIds
                                             .Replace(" ", "")
                                             .Split(',')
                                             .Select(p => p.TrimStart().TrimEnd())
                                             .Select(long.Parse)
                                             .ToList()
                : new List <long>();

            var buildProviderSettings = new BuildProviderSettings
            {
                AccessToken = LighthouseSettings.Token,
                Collection  = LighthouseSettings.Collection,
                Instance    = LighthouseSettings.Instance,
                ExcludedBuildDefinitionIds = CreateExcludedBuildDefinitionIds(),
                TeamProjects = CreateTeamProjects()
            };

            await _buildsWatcher.Watch(
                buildService : LighthouseSettings.Service,
                buildProviderSettings : buildProviderSettings,
                refreshInterval : LighthouseSettings.RefreshInterval,
                onRefreshAction : ProcessBuildsStatus);
        }