Skip to content

Commit ed32eaf

Browse files
committed
AWS_ECS_CONTAINER_CPU has added globally to fix the bug
1 parent 55e538e commit ed32eaf

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

master_deploy.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,16 @@ else
283283
fi
284284
log "Memory reservation updated"
285285

286+
#Container Memory reservation
287+
if [ -z $AWS_ECS_CONTAINER_CPU ];
288+
then
289+
echo "No cpu defined . Going with default value 100"
290+
AWS_ECS_CONTAINER_CPU=100
291+
template=$(echo $template | jq --argjson cpu $AWS_ECS_CONTAINER_CPU '.containerDefinitions[0].cpu=$cpu')
292+
else
293+
template=$(echo $template | jq --argjson cpu $AWS_ECS_CONTAINER_CPU '.containerDefinitions[0].cpu=$cpu')
294+
fi
295+
286296
#Port Mapping
287297
Buffer_portmap=$(echo $AWS_ECS_PORTS | sed 's/,/ /g')
288298
for b1 in $Buffer_portmap;
@@ -379,15 +389,6 @@ else
379389
#CONTAINER_CPU
380390
ECS_NETWORKTYPE="bridge"
381391
template=$(echo $template | jq --arg networkMode $ECS_NETWORKTYPE '.networkMode=$networkMode')
382-
#Container Memory reservation
383-
if [ -z $AWS_ECS_CONTAINER_CPU ];
384-
then
385-
echo "No cpu defined . Going with default value 100"
386-
AWS_ECS_CONTAINER_CPU=100
387-
template=$(echo $template | jq --argjson cpu $AWS_ECS_CONTAINER_CPU '.containerDefinitions[0].cpu=$cpu')
388-
else
389-
template=$(echo $template | jq --argjson cpu $AWS_ECS_CONTAINER_CPU '.containerDefinitions[0].cpu=$cpu')
390-
fi
391392

392393
# Updating the compatibiltiy
393394
template=$(echo $template | jq --arg requiresCompatibilities EC2 '.requiresCompatibilities[0] = $requiresCompatibilities')

0 commit comments

Comments
 (0)