-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·52 lines (41 loc) · 1.44 KB
/
update.sh
File metadata and controls
executable file
·52 lines (41 loc) · 1.44 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
if [ -z ${PLUGIN_CLUSTER} ]; then
echo "missing required parameter cluster"
exit 1
fi
if [ -z ${PLUGIN_IMAGE_NAME} ] && [ -z ${PLUGIN_IMAGE_TAG} ]; then
echo "either image name or image tag parameter is required"
exit 1
fi
if [ -z ${PLUGIN_SERVICE} ]; then
echo "missing required parameter service"
exit 1
fi
if [ -z ${PLUGIN_AWS_REGION} ]; then
PLUGIN_AWS_REGION="us-east-1"
fi
if [ -z ${PLUGIN_TIMEOUT} ]; then
PLUGIN_TIMEOUT="300"
fi
if [ -z ${PLUGIN_MAX} ]; then
PLUGIN_MAX="200"
fi
COPY_TAGS_FLAG=""
if [ "${PLUGIN_TASK_DEFINITION_TAGS}" = "true" ]; then
COPY_TAGS_FLAG="--copy-task-definition-tags"
fi
if [ -z ${PLUGIN_MIN} ]; then
PLUGIN_MIN="100"
fi
if [ ! -z ${PLUGIN_AWS_ACCESS_KEY_ID} ]; then
AWS_ACCESS_KEY_ID=$PLUGIN_AWS_ACCESS_KEY_ID
fi
if [ ! -z ${PLUGIN_AWS_SECRET_ACCESS_KEY} ]; then
AWS_SECRET_ACCESS_KEY=$PLUGIN_AWS_SECRET_ACCESS_KEY
fi
if [ ! -z ${PLUGIN_IMAGE_TAG} ]; then
# ecs-deploy base container puts the script in the fs root :(
/ecs-deploy --region ${PLUGIN_AWS_REGION} --cluster ${PLUGIN_CLUSTER} --tag-only ${PLUGIN_IMAGE_TAG} --image ignore --service-name ${PLUGIN_SERVICE} --timeout ${PLUGIN_TIMEOUT} --min ${PLUGIN_MIN} --max ${PLUGIN_MAX} ${COPY_TAGS_FLAG}
else
/ecs-deploy --region ${PLUGIN_AWS_REGION} --cluster ${PLUGIN_CLUSTER} --image ${PLUGIN_IMAGE_NAME} --service-name ${PLUGIN_SERVICE} --timeout ${PLUGIN_TIMEOUT} --min ${PLUGIN_MIN} --max ${PLUGIN_MAX} ${COPY_TAGS_FLAG}
fi