Exemplo n.º 1
0
        public string CreateReleaseNotes(string currentCommitId)
        {
            //Step 1. Get Current Production Release Number from OD
            var octopusDeployVersion = _octopusDeployService.FindCurrentlyDeployedProductionVersion(_octopusDeploySettings.ProjectName, _octopusDeploySettings.EnvironmentName);

            //Step 2. Get Build Number From TC
            var buildNumber = _octopusToTeamcityMappingStrategy.GetTeamCityBuildNumberFromOctopusReleaseNumber(octopusDeployVersion.VersionNumber);

            // Step 3. Get tag label
            var tagLabel = _buildIdToTagNameStratergy.GetTagName(buildNumber);

            //Step 4. Get Commits since last deploy.
            var commits = _sourceControlService.GetCommitsBetweenTag_AndCommit(tagLabel, currentCommitId);

            //Step 5. Get Rsolved Jira issues since last deploy

            var issues = _bugTrackingService.GetIssuesResolvedSinceDate(octopusDeployVersion.DateReleaseCreated);

            //Step 6. Collate commits and issues into text document and save to disk.

            return(new ReleaseNoteFileCreator().CreateFile(commits, issues));
        }