Skip to content

DeployBlueGreenAction class to handle CodeDeploy deployments#121

Open
joaoricardo000 wants to merge 5 commits into
fabfuel:developfrom
joaoricardo000:feature/blue-green-deploy
Open

DeployBlueGreenAction class to handle CodeDeploy deployments#121
joaoricardo000 wants to merge 5 commits into
fabfuel:developfrom
joaoricardo000:feature/blue-green-deploy

Conversation

@joaoricardo000

Copy link
Copy Markdown
  • Add a new option for ecs deploy function.
  • Code Deploy Application Name --cd-application-name AppECS-service-name
  • If --cd-application-name is given, a DeployBlueGreenAction instance is created to handle the creation and monitoring of the CodeDeploy deployment process.

Example call/output:

$ ecs deploy cluster-name service-name --task task-def-name --image docker_image --cd-application-name AppECS-cd-service-name  
  
Deploying based on task definition: task-def-name:99

Updating task definition
Changed image of container "container-name" to: "docker_image" (was: "old_docker_image")

Creating new task definition revision
Successfully created revision: 100

Updating service

Deployment created: d-LAAKLJFF0
	https://us-east-1.console.aws.amazon.com/codesuite/codedeploy/deployments/d-LAAKLJFF0

Successfully changed task definition to: task-def-name:100

Deploying new task definition..............................................................................
Deployment successful

Deregister task definition revision
Successfully deregistered revision: 99

Related to #120

Comment thread ecs_deploy/cli.py
)

if type(deployment) == DeployBlueGreenAction:
_cd_deploy_url = 'https://us-east-1.console.aws.amazon.com/codesuite/codedeploy/deployments/'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joaoricardo000 Will it always be us-east-1? Or should it be the same region as you are deploying to?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this needs to be configurable, like the regions are in the deploy, scale, etc. commands.
In addition this should be configured and falling back to a default inside the Action, not in the CLI controller, please.

Comment thread ecs_deploy/ecs.py
'Properties': {
'TaskDefinition': task_definition.arn,
'LoadBalancerInfo': {
'ContainerName': self.service['loadBalancers'][0]['containerName'],

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this imply, that a task definition does not have more than one containers?

Comment thread ecs_deploy/ecs.py
return self._deployment_target_id

def deploy(self, task_definition):
response = self.client.codedeploy.create_deployment(

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this like makes the class to a "codedeploy-deploy" tool, rather then an "ecs-deploy" too.
I'm still thinking, if this use-case might be a bit out of the scope of the project.

Comment thread ecs_deploy/cli.py
)

if type(deployment) == DeployBlueGreenAction:
_cd_deploy_url = 'https://us-east-1.console.aws.amazon.com/codesuite/codedeploy/deployments/'

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this needs to be configurable, like the regions are in the deploy, scale, etc. commands.
In addition this should be configured and falling back to a default inside the Action, not in the CLI controller, please.

@quinn

quinn commented Jun 13, 2023

Copy link
Copy Markdown

Anything I can do to get this over the finish line? or, another option would be to have a flag to disable the deploy after updating the task def.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants