From 27930c151a6c16331a145e26c7e7fc5ab8076881 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Thu, 8 Sep 2022 15:07:41 +0530 Subject: [PATCH 1/3] extra host entry feature has added --- master_deploy.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index 83fc1f0..e325ea5 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -37,6 +37,7 @@ ECS_TEMPLATE_TYPE="EC2" task_def="" CONTAINER_LOG_DRIVER="awslogs" portcount=0 +extrahostcount=0 envcount=0 psenvcount=0 volcount=0 @@ -211,6 +212,14 @@ portmapping() { let portcount=portcount+1 } +extrahostentrymapping() { + extrahostname=$1 + extraipAddress=$2 + + template=$(echo $template | jq --argjson extrahostname $extrahostname --argjson extraipAddress $extraipAddress --arg extrahostcount $extrahostcount '.containerDefinitions[0].extraHosts[$extrahostcount |tonumber] |= .+ { ipAddress: $extraipAddress, hostname: $extrahostname }') + let extrahostcount=extrahostcount+1 +} + envaddition() { #echo "envcount before " $envcount envname=$1 @@ -341,7 +350,24 @@ ECS_template_create_register() { portmapping $hostport $containerport $protocolmapped done log "ECS container port mapping updated" - + + #Extrahost entry mapping + if [ -z $AWS_ECS_EXTRA_HOSTENTRY ]; + then + log "Extra host entries are not provided." + else + Buffer_Extrahostentry=$(echo $AWS_ECS_EXTRA_HOSTENTRY | sed 's/,/ /g') + for beh1 in $Buffer_Extrahostentry; + do + extrahostname=$( echo $beh1 | cut -d ':' -f 1 ) + log "ECS extra host name: $extrahostname" + extraipAddress=$( echo $beh1 | cut -d ':' -f 2 ) + log "ECS extra host address: $extraipAddress" + extrahostentrymapping $extrahostname $extraipAddress + done + log "Extra host entries are updated." + fi + # Environment addition Buffer_seclist=$(echo $SEC_LIST | sed 's/,/ /g') for listname in $Buffer_seclist; From 89196403eefb519efcd6a003b7402de878c28819 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Thu, 8 Sep 2022 23:21:34 +0530 Subject: [PATCH 2/3] invalid json --- master_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index e325ea5..6f26e41 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -216,7 +216,7 @@ extrahostentrymapping() { extrahostname=$1 extraipAddress=$2 - template=$(echo $template | jq --argjson extrahostname $extrahostname --argjson extraipAddress $extraipAddress --arg extrahostcount $extrahostcount '.containerDefinitions[0].extraHosts[$extrahostcount |tonumber] |= .+ { ipAddress: $extraipAddress, hostname: $extrahostname }') + template=$(echo $template | jq --argjson extrahostname "$extrahostname" --argjson extraipAddress "$extraipAddress" --arg extrahostcount $extrahostcount '.containerDefinitions[0].extraHosts[$extrahostcount |tonumber] |= .+ { ipAddress: $extraipAddress, hostname: $extrahostname }') let extrahostcount=extrahostcount+1 } From 8f1e737e00ce57b72f4cb58443bfc94874173531 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Thu, 8 Sep 2022 23:35:37 +0530 Subject: [PATCH 3/3] invalid json issue fix --- master_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index 6f26e41..7a7074b 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -216,7 +216,7 @@ extrahostentrymapping() { extrahostname=$1 extraipAddress=$2 - template=$(echo $template | jq --argjson extrahostname "$extrahostname" --argjson extraipAddress "$extraipAddress" --arg extrahostcount $extrahostcount '.containerDefinitions[0].extraHosts[$extrahostcount |tonumber] |= .+ { ipAddress: $extraipAddress, hostname: $extrahostname }') + template=$(echo $template | jq --arg extrahostname $extrahostname --arg extraipAddress $extraipAddress --arg extrahostcount $extrahostcount '.containerDefinitions[0].extraHosts[$extrahostcount |tonumber] |= .+ { ipAddress: $extraipAddress, hostname: $extrahostname }') let extrahostcount=extrahostcount+1 } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy