예제 #1
0
 public DeployStatusInfo(OctopusEnvironmentInfo environment, List<TeamCityBuildInfo> buildInfo, IEnumerable<TrelloCardInfo> branchRelatedTrellos, IEnumerable<TrelloCardInfo> environmentTaggedCards, string branchName)
 {
     Environment = environment;
     BuildInfo = buildInfo;
     BranchRelatedTrellos = branchRelatedTrellos;
     EnvironmentTaggedTrellos = environmentTaggedCards;
     BranchName = branchName;
 }
 public DeployStatusInfo(OctopusEnvironmentInfo environment, List <TeamCityBuildInfo> buildInfo, IEnumerable <TrelloCardInfo> branchRelatedTrellos, IEnumerable <TrelloCardInfo> environmentTaggedCards, string branchName)
 {
     Environment              = environment;
     BuildInfo                = buildInfo;
     BranchRelatedTrellos     = branchRelatedTrellos;
     EnvironmentTaggedTrellos = environmentTaggedCards;
     BranchName               = branchName;
 }
        private bool TryGetFromOctopus(OctopusEnvironmentInfo environment, out string deployerName)
        {
            if (!octopusDeployUsersToIgnore.Any(x => x.Equals(environment.DisplayName, StringComparison.OrdinalIgnoreCase)))
            {
                deployerName = environment.DisplayName;
                return true;
            }

            deployerName = null;
            return false;
        }
예제 #4
0
        private async Task<DeployStatusInfo> GetDeployStatusInfo(TeamCityClient teamCityClient, OctopusEnvironmentInfo environment,
            TrelloClient trelloClient)
        {
            var buildInfo = (await teamCityClient.GetBuildsContaining(new Version(environment.ReleaseVersion))).ToList();

            var branchName = GetBranchNameFromReleaseNotes(environment.ReleaseNotes);
            if (string.IsNullOrWhiteSpace(branchName) && buildInfo.Any())
                branchName = buildInfo.First(x => !string.IsNullOrWhiteSpace(x.BranchName)).BranchName;

            var branchRelatedTrelloCards = Enumerable.Empty<TrelloCardInfo>();
            if (!string.IsNullOrWhiteSpace(branchName))
                branchRelatedTrelloCards = await trelloClient.GetCardsLinkedToBranch(branchName);

            var labelRelatedCards = await trelloClient.GetCardsLinkedToLabel(environment.Name);

            return new DeployStatusInfo(environment, buildInfo, branchRelatedTrelloCards, labelRelatedCards, branchName);
        }
예제 #5
0
        private async Task <DeployStatusInfo> GetDeployStatusInfo(TeamCityClient teamCityClient, OctopusEnvironmentInfo environment,
                                                                  TrelloClient trelloClient)
        {
            var buildInfo = (await teamCityClient.GetBuildsContaining(new Version(environment.ReleaseVersion))).ToList();

            var branchName = GetBranchNameFromReleaseNotes(environment.ReleaseNotes);

            if (string.IsNullOrWhiteSpace(branchName) && buildInfo.Any())
            {
                branchName = buildInfo.First(x => !string.IsNullOrWhiteSpace(x.BranchName)).BranchName;
            }

            var branchRelatedTrelloCards = Enumerable.Empty <TrelloCardInfo>();

            if (!string.IsNullOrWhiteSpace(branchName))
            {
                branchRelatedTrelloCards = await trelloClient.GetCardsLinkedToBranch(branchName);
            }

            var labelRelatedCards = await trelloClient.GetCardsLinkedToLabel(environment.Name);

            return(new DeployStatusInfo(environment, buildInfo, branchRelatedTrelloCards, labelRelatedCards, branchName));
        }