-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathdeploy-to-incubator.bash
More file actions
36 lines (29 loc) · 815 Bytes
/
deploy-to-incubator.bash
File metadata and controls
36 lines (29 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
function print_usage {
printf "usage: %s <IMAGE_URL>\n" $0
}
IMAGE_URL=
while [[ $# -gt 0 ]]; do
case $1 in
-i|--image) IMAGE_URL=$2;
shift 2;
;;
*) printf "\e[31margument not supported:\e[0m %s\n" $1
shift;
;;
esac;
done;
if [[ -z "${IMAGE_URL}" ]]; then
print_usage
exit 2;
fi;
ESCAPED_IMAGE_URL=$(echo "${IMAGE_URL}" | sed 's/\//\\\//g')
ECS_TASK_DEFINITION=$( sed "s/__IMAGE_URL__/${ESCAPED_IMAGE_URL}/g" < ./.incubator/ecs-taskdef-template.json )
aws ecs register-task-definition \
--cli-input-json "${ECS_TASK_DEFINITION}" \
| tee ./ecs-taskdef-revision.json
aws ecs update-service \
--cluster incubator-prod \
--service homeuniteus \
--task-definition homeuniteus \
--force-new-deployment