Skip to content

Commit d885101

Browse files
committed
CORE-2054
1 parent 0179534 commit d885101

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

master_deploy.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,19 @@ volumeupdate() {
261261
let volcount=volcount+1
262262
}
263263

264+
efsvolumeupdate() {
265+
volname=$1
266+
sourcepath=$2
267+
mountpath=$3
268+
filesystemid=$4
269+
#volumes update
270+
template=$(echo $template | jq --arg volname $volname --arg sourcepath $sourcepath --arg volcount $volcount --arg filesystemid $filesystemid '.volumes[$volcount |tonumber] |= .+ { name: $volname, efsVolumeConfiguration: { fileSystemId: $filesystemid, rootDirectory: $sourcepath } }')
271+
#mount point update
272+
template=$(echo $template | jq --arg volname $volname --arg mountpath $mountpath --arg volcount $volcount '.containerDefinitions[0].mountPoints[$volcount |tonumber] |= .+ { sourceVolume: $volname, containerPath: $mountpath }')
273+
274+
let volcount=volcount+1
275+
}
276+
264277
ECS_Container_HealthCheck_integ() {
265278
HealthCheckCmd="$1"
266279

@@ -447,6 +460,25 @@ ECS_template_create_register() {
447460
log "ECS volumes are mapped"
448461
fi
449462

463+
#efs volume update
464+
if [ -z $AWS_ECS_VOLUMES_EFS ];
465+
then
466+
echo "No ECS EFS volume mapping defined"
467+
else
468+
Buffer_volumes=$(echo $AWS_ECS_VOLUMES_EFS | sed 's/,/ /g')
469+
for v1 in $Buffer_volumes;
470+
do
471+
volname=$( echo $v1 | cut -d ':' -f 1 )
472+
sourcepath=$( echo $v1 | cut -d ':' -f 2 )
473+
mountpath=$( echo $v1 | cut -d ':' -f 3 )
474+
filesystemid=$( echo $v1 | cut -d ':' -f 4 )
475+
#mntpermission=$( echo $v1 | cut -d ':' -f 4 )
476+
#volumeupdate $volname $sourcepath $mountpath $mntpermission fileSystemId
477+
efsvolumeupdate $volname $sourcepath $mountpath $filesystemid
478+
done
479+
log "ECS EFS volumes are mapped"
480+
fi
481+
450482
#Container health check update
451483
if [ -z "$AWS_ECS_CONTAINER_HEALTH_CMD" ];
452484
then

0 commit comments

Comments
 (0)