Skip to content

Commit

Permalink
Merge pull request #169 from CircleCI-Public/fix-cluster-parameter
Browse files Browse the repository at this point in the history
fix!: renamed cluster-name parameter to cluster for consistency
  • Loading branch information
brivu authored Jun 23, 2022
2 parents 9c88f23 + f9512d4 commit 0f2434b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
32 changes: 16 additions & 16 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ jobs:
- aws-ecs/update-service:
family: "<< parameters.family-name >>"
service-name: "<< parameters.service-name >>"
cluster-name: "<< parameters.aws-resource-name-prefix >>-cluster"
cluster: "<< parameters.aws-resource-name-prefix >>-cluster"
container-image-name-updates: "container=<< parameters.aws-resource-name-prefix >>-service,image-and-tag=$FULL_IMAGE_NAME"
container-env-var-updates: 'container=<< parameters.aws-resource-name-prefix >>-service,name=VERSION_INFO,value="${CIRCLE_SHA1}_${CIRCLE_BUILD_NUM}",container=<< parameters.aws-resource-name-prefix >>-service,name=BUILD_DATE,value=$(date)'
verify-revision-is-deployed: true
fail-on-verification-timeout: false
profile-name: "<<parameters.profile-name>>"
- test-deployment:
service-name: "<< parameters.aws-resource-name-prefix >>-service"
cluster-name: "<< parameters.aws-resource-name-prefix >>-cluster"
cluster: "<< parameters.aws-resource-name-prefix >>-cluster"
test-task-definition-update:
docker:
- image: cimg/python:3.10.4
Expand Down Expand Up @@ -403,7 +403,7 @@ workflows:
aws-region: AWS_DEFAULT_REGION
profile-name: "ECS_TEST_PROFILE"
family: "${AWS_RESOURCE_NAME_PREFIX_FARGATE}-service"
cluster-name: "${AWS_RESOURCE_NAME_PREFIX_FARGATE}-cluster"
cluster: "${AWS_RESOURCE_NAME_PREFIX_FARGATE}-cluster"
container-env-var-updates: 'container=${AWS_RESOURCE_NAME_PREFIX_FARGATE}-service,name=VERSION_INFO,value="${CIRCLE_SHA1}_${CIRCLE_BUILD_NUM}",container=${AWS_RESOURCE_NAME_PREFIX_FARGATE}-service,name=BUILD_DATE,value=$(date)'
# test the force-new-deployment flag
force-new-deployment: true
Expand All @@ -414,7 +414,7 @@ workflows:
post-steps:
- test-deployment:
service-name: "${AWS_RESOURCE_NAME_PREFIX_FARGATE}-service"
cluster-name: "${AWS_RESOURCE_NAME_PREFIX_FARGATE}-cluster"
cluster: "${AWS_RESOURCE_NAME_PREFIX_FARGATE}-cluster"
- aws-ecs/deploy-service-update:
name: fargate_test-update-service-skip-registration
docker-image-for-job: cimg/python:3.10.4
Expand All @@ -425,7 +425,7 @@ workflows:
aws-region: AWS_DEFAULT_REGION
profile-name: "ECS_TEST_PROFILE"
family: "${AWS_RESOURCE_NAME_PREFIX_FARGATE}-service"
cluster-name: "${AWS_RESOURCE_NAME_PREFIX_FARGATE}-cluster"
cluster: "${AWS_RESOURCE_NAME_PREFIX_FARGATE}-cluster"
# test skipping registration of a new task definition
skip-task-definition-registration: true
# test the enable-circuit-breaker flag
Expand Down Expand Up @@ -518,14 +518,14 @@ workflows:
aws-region: AWS_DEFAULT_REGION
family: "${AWS_RESOURCE_NAME_PREFIX_EC2}-family"
service-name: "${AWS_RESOURCE_NAME_PREFIX_EC2}-service"
cluster-name: "${AWS_RESOURCE_NAME_PREFIX_EC2}-cluster"
cluster: "${AWS_RESOURCE_NAME_PREFIX_EC2}-cluster"
container-env-var-updates: 'container=${AWS_RESOURCE_NAME_PREFIX_EC2}-service,name=VERSION_INFO,value="Asterisk * expansion test ${CIRCLE_SHA1}_${CIRCLE_BUILD_NUM}",container=${AWS_RESOURCE_NAME_PREFIX_EC2}-service,name=BUILD_DATE,value=$(date)'
verify-revision-is-deployed: true
fail-on-verification-timeout: false
post-steps:
- test-deployment:
service-name: "${AWS_RESOURCE_NAME_PREFIX_EC2}-service"
cluster-name: "${AWS_RESOURCE_NAME_PREFIX_EC2}-cluster"
cluster: "${AWS_RESOURCE_NAME_PREFIX_EC2}-cluster"
test-asterisk-expansion: true

- tear-down-test-env:
Expand Down Expand Up @@ -587,7 +587,7 @@ workflows:
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-region: AWS_DEFAULT_REGION
family: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service"
cluster-name: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-cluster"
cluster: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-cluster"
container-image-name-updates: "container=${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service,image-and-tag=${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}:${CIRCLE_SHA1}"
container-env-var-updates: 'container=${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service,name=VERSION_INFO,value="${CIRCLE_SHA1}_${CIRCLE_BUILD_NUM}",container=${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service,name=BUILD_DATE,value=$(date)'
deployment-controller: "CODE_DEPLOY"
Expand All @@ -603,7 +603,7 @@ workflows:
deployment-group-name: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-codedeploygroup"
- test-deployment:
service-name: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service"
cluster-name: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-cluster"
cluster: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-cluster"
delete-load-balancer: false
- aws-ecs/deploy-service-update:
name: codedeploy_fargate_test-update-and-wait-service-job
Expand All @@ -615,7 +615,7 @@ workflows:
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-region: AWS_DEFAULT_REGION
family: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service"
cluster-name: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-cluster"
cluster: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-cluster"
container-image-name-updates: "container=${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service,image-and-tag=${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}:${CIRCLE_SHA1}"
container-env-var-updates: 'container=${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service,name=VERSION_INFO,value="${CIRCLE_SHA1}_${CIRCLE_BUILD_NUM}",container=${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service,name=BUILD_DATE,value=$(date)'
deployment-controller: "CODE_DEPLOY"
Expand All @@ -628,11 +628,11 @@ workflows:
post-steps:
- test-deployment:
service-name: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service"
cluster-name: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-cluster"
cluster: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-cluster"
delete-load-balancer: true
- delete-service:
service-name: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-service"
cluster-name: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-cluster"
cluster: "${AWS_RESOURCE_NAME_PREFIX_CODEDEPLOY_FARGATE}-cluster"
- tear-down-test-env:
name: codedeploy_fargate_tear-down-test-env
requires:
Expand Down Expand Up @@ -688,15 +688,15 @@ commands:
service-name:
description: "Name of the ECS service"
type: string
cluster-name:
cluster:
description: "Name of the cluster"
type: string
steps:
- run:
name: Delete ECS service
command: |
aws ecs delete-service \
--cluster << parameters.cluster-name >> \
--cluster << parameters.cluster>> \
--service << parameters.service-name >> \
--force
test-deployment:
Expand All @@ -705,7 +705,7 @@ commands:
service-name:
description: "Name of the ECS service"
type: string
cluster-name:
cluster:
description: "Name of the cluster"
type: string
test-asterisk-expansion:
Expand All @@ -721,7 +721,7 @@ commands:
name: Test deployment (for orb testing and is not part of the orb)
command: |-
set -x
TARGET_GROUP_ARN=$(aws ecs describe-services --cluster << parameters.cluster-name >> --services << parameters.service-name >> | jq -r '.services[0].loadBalancers[0].targetGroupArn')
TARGET_GROUP_ARN=$(aws ecs describe-services --cluster << parameters.cluster >> --services << parameters.service-name >> | jq -r '.services[0].loadBalancers[0].targetGroupArn')
ELB_ARN=$(aws elbv2 describe-target-groups --target-group-arns $TARGET_GROUP_ARN | jq -r '.TargetGroups[0].LoadBalancerArns[0]')
ELB_DNS_NAME=$(aws elbv2 describe-load-balancers --load-balancer-arns $ELB_ARN | jq -r '.LoadBalancers[0].DNSName')
echo "ELB DNS NAME: $ELB_DNS_NAME"
Expand Down
6 changes: 3 additions & 3 deletions src/commands/update-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
family:
description: Name of the task definition's family.
type: string
cluster-name:
cluster:
description: The short name or full ARN of the cluster that hosts the service.
type: string
service-name:
Expand Down Expand Up @@ -201,7 +201,7 @@ steps:
ECS_PARAM_SERVICE_NAME: <<parameters.service-name>>
ECS_PARAM_FAMILY: <<parameters.family>>
ECS_PARAM_FORCE_NEW_DEPLOY: <<parameters.force-new-deployment>>
ECS_PARAM_CLUSTER_NAME: <<parameters.cluster-name>>
ECS_PARAM_CLUSTER_NAME: <<parameters.cluster>>
ECS_PARAM_PROFILE_NAME: <<parameters.profile-name>>
ECS_PARAM_ENABLE_CIRCUIT_BREAKER: <<parameters.enable-circuit-breaker>>

Expand All @@ -215,7 +215,7 @@ steps:
steps:
- verify-revision-is-deployed:
family: << parameters.family >>
cluster-name: << parameters.cluster-name >>
cluster: << parameters.cluster >>
service-name: << parameters.service-name >>
task-definition-arn: $CCI_ORB_AWS_ECS_DEPLOYED_REVISION
max-poll-attempts: << parameters.max-poll-attempts >>
Expand Down
4 changes: 2 additions & 2 deletions src/commands/verify-revision-is-deployed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parameters:
family:
description: Name of the task definition's family.
type: string
cluster-name:
cluster:
description: The short name or full ARN of the cluster that hosts the service.
type: string
service-name:
Expand Down Expand Up @@ -45,7 +45,7 @@ steps:
ECS_PARAM_FAMILY: <<parameters.family>>
ECS_PARAM_TASK_DEF_ARN: <<parameters.task-definition-arn>>
ECS_PARAM_MAX_POLL_ATTEMPTS: <<parameters.max-poll-attempts>>
ECS_PARAM_CLUSTER_NAME: <<parameters.cluster-name>>
ECS_PARAM_CLUSTER_NAME: <<parameters.cluster>>
ECS_PARAM_POLL_INTERVAL: <<parameters.poll-interval>>
ECS_PARAM_FAIL_ON_VERIFY_TIMEOUT: <<parameters.fail-on-verification-timeout>>
ECS_PARAM_PROFILE_NAME: <<parameters.profile-name>>
2 changes: 1 addition & 1 deletion src/examples/deploy-service-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ usage:
requires:
- aws-ecr/build-and-push-image
family: '${MY_APP_PREFIX}-service'
cluster-name: '${MY_APP_PREFIX}-cluster'
cluster: '${MY_APP_PREFIX}-cluster'
container-image-name-updates: 'container=${MY_APP_PREFIX}-service,tag=${CIRCLE_SHA1}'
2 changes: 1 addition & 1 deletion src/examples/update-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ usage:
aws-region: AWS_DEFAULT_REGION
- aws-ecs/update-service:
family: '${MY_APP_PREFIX}-service'
cluster-name: '${MY_APP_PREFIX}-cluster'
cluster: '${MY_APP_PREFIX}-cluster'
container-image-name-updates: 'container=${MY_APP_PREFIX}-service,tag=stable'
workflows:
deploy:
Expand Down
2 changes: 1 addition & 1 deletion src/examples/verify-revision-deplopyment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ usage:
$BASH_ENV
- aws-ecs/verify-revision-is-deployed:
family: '${MY_APP_PREFIX}-service'
cluster-name: '${MY_APP_PREFIX}-cluster'
cluster: '${MY_APP_PREFIX}-cluster'
task-definition-arn: '${TASK_DEFINITION_ARN}'
workflows:
test-workflow:
Expand Down
4 changes: 2 additions & 2 deletions src/jobs/deploy-service-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parameters:
family:
description: Name of the task definition's family.
type: string
cluster-name:
cluster:
description: The short name or full ARN of the cluster that hosts the service.
type: string
service-name:
Expand Down Expand Up @@ -193,7 +193,7 @@ steps:
profile-name: << parameters.profile-name >>
- update-service:
family: << parameters.family >>
cluster-name: << parameters.cluster-name >>
cluster: << parameters.cluster >>
service-name: << parameters.service-name >>
deployment-controller: << parameters.deployment-controller >>
enable-circuit-breaker: << parameters.enable-circuit-breaker >>
Expand Down

0 comments on commit 0f2434b

Please sign in to comment.