Skip to content

Commit

Permalink
Merge pull request #20 from DNXLabs/add-capacity-provider
Browse files Browse the repository at this point in the history
Add Capacity Provider
  • Loading branch information
lzrocha authored Oct 31, 2022
2 parents 794070c + 96e3d0e commit 3d43023
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM dnxsolutions/aws:1.22.48
FROM dnxsolutions/aws:1.22.48-dnx2

WORKDIR /work

Expand Down
10 changes: 5 additions & 5 deletions src/app-spec.tpl.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"revisionType": "AppSpecContent",
"appSpecContent": {
"content": "{\"version\":1,\"Resources\":[{\"TargetService\":{\"Type\":\"AWS::ECS::Service\",\"Properties\":{\"TaskDefinition\":\"$TASK_ARN\",\"LoadBalancerInfo\":{\"ContainerName\":\"$APP_NAME\",\"ContainerPort\":$CONTAINER_PORT}}}}]}"
}
}
"revisionType": "AppSpecContent",
"appSpecContent": {
"content": "{\"version\":1,\"Resources\":[{\"TargetService\":{\"Type\":\"AWS::ECS::Service\",\"Properties\":{\"TaskDefinition\":\"$TASK_ARN\",\"LoadBalancerInfo\":{\"ContainerName\":\"$APP_NAME\",\"ContainerPort\":$CONTAINER_PORT}$CAPACITY_PROVIDER_STRATEGY}}}]}"
}
}
4 changes: 4 additions & 0 deletions src/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ OUTPUT_TASK_ARN=$(echo $OUTPUT_TASK_ARN | jq --raw-output '.taskDefinition.taskD
export TASK_ARN=$OUTPUT_TASK_ARN

# ----- Create app spec file -----
if [ ! -z "$CAPACITY_PROVIDER_STRATEGY" ]; then
CAPACITY_PROVIDER_STRATEGY=',\"CapacityProviderStrategy\":['${CAPACITY_PROVIDER_STRATEGY}']'
fi

h1 "Step 4: Creating App Spec for CodeDeploy"
runCommand "envsubst < app-spec.tpl.json > app-spec.json" \
"Create app-spec file failed" \
Expand Down

0 comments on commit 3d43023

Please sign in to comment.