Ejemplo n.º 1
0
        public async Task Handle(HealthCheckRequest <TeamCityBuild> request, CancellationToken cancellationToken)
        {
            var client = new TeamCityClient(new TeamCityConnection());

            request.DataContext.CopyTo(client.Connection);

            var build = await client.GetBuildDetailsAsync(request.DataContext).ConfigureAwait(false);

            request.DataContext.State   = build.State;
            request.DataContext.Message = build.StatusText;
        }
Ejemplo n.º 2
0
        public void Handle(TeamCityBuild teamCityBuid)
        {
            var teamCityClient = new TeamCityClient(new TeamCityConnection());

            teamCityBuid.MapTo(teamCityClient.Connection);

            var buildDetails = teamCityClient.GetBuildDetailsAsync(teamCityBuid).Result;

            teamCityBuid.State     = buildDetails.State;
            teamCityBuid.StateText = buildDetails.StatusText;
        }
Ejemplo n.º 3
0
        public async Task HandleAsync(TeamCityBuild teamCityBuild)
        {
            var result = _dialogService.Show($"Are you sure you want to trigger {teamCityBuild.Name}?", "Trigger a new build", MessageBoxButton.YesNo, MessageBoxImage.Asterisk);

            if (result != MessageBoxResult.Yes)
            {
                return;
            }

            _logger.Info($"Triggering \"{teamCityBuild.Name}\"...");

            var teamCityClient = new TeamCityClient(new TeamCityConnection());

            teamCityBuild.MapTo(teamCityClient.Connection);

            await teamCityClient.QueueNewBuild(teamCityBuild).ConfigureAwait(false);

            _logger.Info($"Build \"{teamCityBuild.Name}\" was triggered.");
        }
Ejemplo n.º 4
0
        public async Task Handle(StartRequest <TeamCityBuild> request, CancellationToken cancellationToken)
        {
            var dialog = new ConfirmationDialog($"Are you sure you want to start {request.DataContext.Name}?");

            var result = _dialogService.ShowDialog(dialog);

            if (result != DialogResult.Yes)
            {
                return;
            }

            _logger.Info($"Starting \"{request.DataContext.Name}\"...");

            var client = new TeamCityClient(new TeamCityConnection());

            request.DataContext.MapTo(client.Connection);

            await client.QueueNewBuild(request.DataContext)
            .ConfigureAwait(false);

            _logger.Info($"Build \"{request.DataContext.Name}\" has been triggered.");
        }