-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Deployment Controller #34
Conversation
@enokawa Thank you so much for taking this on and do let us know once the PR is ready for review 🙂 |
@lokst Please code review!! |
@enokawa Thank you, I'll review this as soon as possible! |
src/orb.yml.hbs
Outdated
deployment-controller: | ||
description: | ||
"The deployment controller to use for the service. Defaulted to ECS" | ||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be great if the type could be an enum: https://circleci.com/docs/2.0/reusing-config/#enum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 4da210a .
src/orb.yml.hbs
Outdated
"The deployment controller to use for the service. Defaulted to ECS" | ||
type: string | ||
default: "ECS" | ||
application-name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be changed to codedeploy-application-name
for clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by e4fd0ed .
src/orb.yml.hbs
Outdated
default: "ECS" | ||
application-name: | ||
description: | ||
"The name of an AWS CodeDeploy application." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to add some more details to the description to clarify the purpose of this parameter:
description: |
The name of the AWS CodeDeploy application used for the deployment.
Only effective when the deployment-controller parameter value is "C
ODE_DEPLOY".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 302f398 .
src/orb.yml.hbs
Outdated
"The name of an AWS CodeDeploy application." | ||
type: string | ||
default: "" | ||
deployment-group-name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be changed to codedeploy-deployment-group-name
for clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 80b9c36 .
src/orb.yml.hbs
Outdated
default: "" | ||
deployment-group-name: | ||
description: | ||
"The name of an AWS CodeDeploy deployment group." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to add some more details to the description to clarify the purpose of this parameter, like this:
description: |
The name of the AWS CodeDeploy deployment group used for the deployment.
Only effective when the deployment-controller parameter value is "C
ODE_DEPLOY".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by a84730b .
src/orb.yml.hbs
Outdated
"The name of an AWS CodeDeploy deployment group." | ||
type: string | ||
default: "" | ||
container-name-for-code-deploy: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be changed to codedeploy-load-balanced-container-name
for clarity? (Please feel free to suggest a better name!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by adcb99c .
src/orb.yml.hbs
Outdated
default: "" | ||
container-name-for-code-deploy: | ||
description: | ||
"The name of the container for CodeDeploy." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to add some more details to the description to clarify the purpose of this parameter, like this:
description: |
The name of the container to be load-balanced via AWS CodeDeploy.
Only effective when the deployment-controller parameter value is "C
ODE_DEPLOY".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 3bd0e61 .
src/orb.yml.hbs
Outdated
"The name of the container for CodeDeploy." | ||
type: string | ||
default: "" | ||
container-port-for-code-deploy: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be changed to codedeploy-load-balanced-container-port
for clarity? (Please feel free to suggest a better name!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 102d851 .
src/orb.yml.hbs
Outdated
default: "" | ||
container-port-for-code-deploy: | ||
description: | ||
"The port of the container for CodeDeploy." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to add some more details to the description to clarify the purpose of this parameter, like this:
description: |
The port of the container to be load-balanced via AWS CodeDeploy.
Only effective when the deployment-controller parameter value is "C
ODE_DEPLOY".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by b7e161f .
--application-name "<< parameters.application-name >>" \ | ||
--deployment-group-name "<< parameters.deployment-group-name >>" \ | ||
--revision '{"revisionType": "AppSpecContent", "appSpecContent": {"content": "{\"version\": 1, \"Resources\": [{\"TargetService\": {\"Type\": \"AWS::ECS::Service\", \"Properties\": {\"TaskDefinition\": \"'${CCI_ORB_AWS_ECS_REGISTERED_TASK_DFN}'\", \"LoadBalancerInfo\": {\"ContainerName\": \"<< parameters.container-name-for-code-deploy >>\", \"ContainerPort\": << parameters.container-port-for-code-deploy >>}}}}]}"}}' \ | ||
--query deploymentId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of the following changes? That way, the verify-revision-is-deployed
parameter should still be able to work if set to true.
DEPLOYED_REVISION="${CCI_ORB_AWS_ECS_REGISTERED_TASK_DFN}"
DEPLOYMENT_ID=$(aws deploy create-deployment ...)
and also adding echo "Created CodeDeploy deployment: $DEPLOYMENT_ID"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great changes! I fixed by ae19b28 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enokawa Thanks so much for this PR. I tested them and found that they work well. I've made some suggestions here and would love if you can review them!
@lokst Thank you for your review! |
…balanced-container-name
…balanced-container-port
@lokst I Fixed them. Please code review again. |
src/orb.yml.hbs
Outdated
@@ -530,24 +535,28 @@ commands: | |||
"The deployment controller to use for the service. Defaulted to ECS" | |||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed out on this in my earlier review. Could this be changed to an enum too? 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed too. Fixed by 500ac8c .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your changes! I gave this a test and realized that some changes will be required to the verify-revision-is-deployed
command in order to support verification for blue/green deployments. Hence could you also update the description
of theverify-revision-is-deployed
command and verify-revision-is-deployed
parameter to add something like "Does not support ECS services that are of the blue/green deployment type." (Of course, feel free to add support for verify-revision-is-deployed: true
if you like, in this PR or another)
Thanks @enokawa, could you also update the description of the |
@lokst Sorry I'm late. I was update |
And I will add support for |
Thanks @enokawa! I am out of office most of this week and will review this once I'm back next week! |
@enokawa Thanks so much for contributing this new feature of blue/green deployment support! Your changes are now available in version |
@lokst Thanks so much!! |
Add Deployment Controller for Blue/Green Deployment.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-bluegreen.html
Ref: #33
I confirmed that B/G Deployment was successful using my own orb.

This is
.circleci/config.yml
.