예제 #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 octopusProject = parameters[1];
                await response.Send($"Got it! Updating project {octopusProject}.");

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

                var url = facade.UpdateProject(octopusProject);

                await response.Send($"Done! Check out the updated project here {url}");
            }
        }