Created
October 19, 2015 23:27
-
-
Save felipesere/8bfc9202516af7572a59 to your computer and use it in GitHub Desktop.
Deploying form Circle-CI to AWS- ECS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
aws --version | |
aws configure set default.region us-west-2 | |
aws configure set default.output json | |
echo "preparing task definition" | |
aws ecs describe-task-definition --task-definition applications | ./jq --arg x $CIRCLE_SHA1 ' .taskDefinition | |
| del(.status) | |
| del(.taskDefinitionArn) | |
| del(.revision) | |
| .containerDefinitions[0].image = ("<DOCKER-REPO>/<DOCKER-IMAGE>:"+$x)' > new-task-definition.json | |
NEW_REVISION=$(aws ecs register-task-definition --cli-input-json file://new-task-definition.json | ./jq '.taskDefinition.revision') | |
echo "updating service definition" | |
aws ecs update-service --cluster <CLUSTER-NAME> --service <SERVICE-NAME> --task-definition "applications:$NEW_REVISION" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice job, dude!