Beispiel #1
0
        public async Task <IActionResult> CheckReleaseStatus(
            [FromBody] AzureDevOpsWebHookEventModel model,
            [FromServices] IReleaseService releaseService)
        {
            string buildId = model?.Resource?.BuildNumber;

            if (string.IsNullOrWhiteSpace(buildId))
            {
                return(BadRequest());
            }

            Build build = await _buildClient.Get(buildId);

            await releaseService.UpdateAsync(new ReleaseEntity
            {
                Build = new BuildEntity
                {
                    Id       = build.Id.ToString(),
                    Status   = build.Status,
                    Result   = build.Result,
                    Started  = build.StartTime,
                    Finished = build.FinishTime
                }
            });

            return(Ok());
        }
Beispiel #2
0
        /// <inheritdoc />
        public async Task UpdateReleaseStatus(string buildNumber)
        {
            Build build = await _azureDevOpsBuildClient.Get(buildNumber);

            await _releaseService.UpdateAsync(new ReleaseEntity
            {
                Build = ToBuildEntity(build)
            });
        }