예제 #1
0
        public override async Task Execute(string[] parameters, IResponse response)
        {
            var apiKey = Environment.GetEnvironmentVariable("OCTOPUS_API_KEY");
            if (string.IsNullOrWhiteSpace(apiKey))
            {
                await response.Send("Octopus Deploy API key has not been configured. Please set it as environment variable `OCTOPUS_API_KEY`");
            }
            else
            {
                var projectGroup = parameters[1];
                await response.Send($"Got it! Updating all projects in {projectGroup}.");

                var facade = new Facade(apiKey, new CachingTemplateRepository(new TeamCityArtifactTemplateRepository()));

                facade.UpdateAllProjects(projectGroup);

                await response.Send("Done!");
            }
        }