File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,14 @@ deploy_cluster() {
95
95
}
96
96
97
97
make_task_def (){
98
- task_template=' [{
98
+ task_template=' {
99
+ "family": "%s"
100
+ "requiresCompatibilities": ["EC2", "FARGATE"],
101
+ "networkMode": "awsvpc",
102
+ "executionRoleArn": "arn:aws:iam::%s:role/ecsTaskExecutionRole",
103
+ "cpu": "1024",
104
+ "memory": "2048",
105
+ "containerDefinitions": [{
99
106
"name": "%s",
100
107
"memory": 1000,
101
108
"cpu" : 0,
@@ -178,14 +185,15 @@ make_task_def(){
178
185
}
179
186
}
180
187
}
181
- ]'
188
+ ]
189
+ }'
182
190
183
- task_def=$( printf " $task_template " $AWS_ECS_CONTAINER_NAME $AWS_ACCOUNT_ID $AWS_REGION $AWS_REPOSITORY $TAG $ENV $AUTH_DOMAIN $AUTH_SECRET $DATABASE_URL $EMAIL_FROM " $JWKS_URI " " $KAFKA_CLIENT_CERT " " $KAFKA_CLIENT_CERT_KEY " $KAFKA_GROUP_ID $KAFKA_URL $LOG_LEVEL $PORT $SENDGRID_API_KEY " $TEMPLATE_MAP " " $VALID_ISSUERS " $PORT $PORT $AWS_ECS_CLUSTER $AWS_REGION $ENV )
191
+ task_def=$( printf " $task_template " $family $AWS_ACCOUNT_ID $ AWS_ECS_CONTAINER_NAME $AWS_ACCOUNT_ID $AWS_REGION $AWS_REPOSITORY $TAG $ENV $AUTH_DOMAIN $AUTH_SECRET $DATABASE_URL $EMAIL_FROM " $JWKS_URI " " $KAFKA_CLIENT_CERT " " $KAFKA_CLIENT_CERT_KEY " $KAFKA_GROUP_ID $KAFKA_URL $LOG_LEVEL $PORT $SENDGRID_API_KEY " $TEMPLATE_MAP " " $VALID_ISSUERS " $PORT $PORT $AWS_ECS_CLUSTER $AWS_REGION $ENV )
184
192
185
193
}
186
194
187
195
register_definition () {
188
- if revision=$( aws ecs register-task-definition --container-definitions " $task_def " --family $family --requires-compatibilities " [ \" EC2 \" , \" FARGATE \" ] " --network-mode " awsvpc " --execution-role-arn " arn:aws:iam:: $AWS_ACCOUNT_ID :role/ecsTaskExecutionRole " --cpu " 1024 " --memory " 2048 " | $JQ ' .taskDefinition.taskDefinitionArn' ) ; then
196
+ if revision=$( aws ecs register-task-definition --cli-input-json " $task_def " | $JQ ' .taskDefinition.taskDefinitionArn' ) ; then
189
197
echo " Revision: $revision "
190
198
else
191
199
echo " Failed to register task definition"
You can’t perform that action at this time.
0 commit comments