diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 629a6b0..35b74c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Run tests - run: docker-compose -f action-services.yml run test + run: docker compose -f action-services.yml run test build-and-publish: name: Build and Publish diff --git a/action-services.yml b/action-services.yml index 4e58821..f76267c 100644 --- a/action-services.yml +++ b/action-services.yml @@ -1,5 +1,3 @@ -version: "3" - services: test: build: . diff --git a/action.yml b/action.yml index 88c4630..86c5837 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -name: 'ESC-Deploy' +name: 'ECS-Deploy' description: 'Simple shell script for initiating blue-green deployments on Amazon EC2 Container Service (ECS)' inputs: aws_access_key_cmd: diff --git a/ecs-deploy b/ecs-deploy index 25478cc..767b936 100755 --- a/ecs-deploy +++ b/ecs-deploy @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Setup default values for variables -VERSION="3.10.17" +VERSION="3.10.18" CLUSTER=false SERVICE=false TASK_DEFINITION=false @@ -43,7 +43,7 @@ Required arguments: -k | --aws-access-key AWS Access Key ID. May also be set as environment variable AWS_ACCESS_KEY_ID -s | --aws-secret-key AWS Secret Access Key. May also be set as environment variable AWS_SECRET_ACCESS_KEY -r | --region AWS Region Name. May also be set as environment variable AWS_DEFAULT_REGION - -p | --profile AWS Profile to use - If you set this aws-access-key, aws-secret-key and region are needed + -p | --profile AWS Profile to use - If you set this, then aws-access-key, aws-secret-key and region are not needed -c | --cluster Name of ECS cluster -i | --image Name of Docker image to run, ex: repo/image:latest Format: [domain][:port][/repo][/][image][:tag] @@ -374,7 +374,7 @@ function createNewTaskDefJson() { # Some options in task definition should only be included in new definition if present in # current definition. If found in current definition, append to JQ filter. - CONDITIONAL_OPTIONS=(networkMode taskRoleArn placementConstraints executionRoleArn runtimePlatform ephemeralStorage) + CONDITIONAL_OPTIONS=(networkMode taskRoleArn placementConstraints executionRoleArn runtimePlatform ephemeralStorage proxyConfiguration) for i in "${CONDITIONAL_OPTIONS[@]}"; do re=".*${i}.*" if [[ "$DEF" =~ $re ]]; then diff --git a/test.bats b/test.bats index 698daf8..00d0e95 100755 --- a/test.bats +++ b/test.bats @@ -686,3 +686,63 @@ EOF [ "$output" == "something:tag_123" ] echo "output = $output" 1>&2 } + +@test "test createNewTaskDefJson with existing proxyConfiguration value" { + imageWithoutTag="121212345678.dkr.ecr.us-east-1.amazonaws.com/acct/repo" + useImage="121212345678.dkr.ecr.us-east-1.amazonaws.com/acct/repo:1111111111" + TASK_DEFINITION=$(cat <