From 36bf3edfa32206d6daf315e55f5968b705f2f545 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Wed, 31 Jul 2024 11:51:09 +0200 Subject: [PATCH] added GOOGLE_MAPS_AUTHENTICATION_PARAMS param option -m to upgrade-landscape.sh script hierarchy --- .../paris2024/launch-replicas-in-all-regions.sh | 9 +++++++-- .../paris2024/launch-replicas-in-region.sh | 7 +++++-- .../on-site-scripts/paris2024/upgrade-landscape.sh | 11 ++++++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/configuration/on-site-scripts/paris2024/launch-replicas-in-all-regions.sh b/configuration/on-site-scripts/paris2024/launch-replicas-in-all-regions.sh index 0e7babf0298..634e42c8525 100755 --- a/configuration/on-site-scripts/paris2024/launch-replicas-in-all-regions.sh +++ b/configuration/on-site-scripts/paris2024/launch-replicas-in-all-regions.sh @@ -2,11 +2,12 @@ TARGET_GROUP_NAME=S-paris2024 if [ $# -eq 0 ]; then - echo "$0 -R -b [-t ] [-i ] [-k ]" + echo "$0 -R -b -m [-t ] [-i ] [-k ]" echo "" echo "-b replication bearer token; mandatory" echo "-i Amazon Machine Image (AMI) ID to use to launch the instance; defaults to latest image tagged with image-type:sailing-analytics-server" echo "-k Key pair name, mapping to the --key-name parameter; defaults to Axel" + echo "-m Google Maps API key, used for the GOOGLE_MAPS_AUTHENTICATION_PARAMS variable" echo "-R release name; must be provided to select the release, e.g., build-202106040947" echo "-t Instance type; defaults to ${INSTANCE_TYPE}" echo @@ -19,13 +20,14 @@ if [ $# -eq 0 ]; then echo "in that region, with all auto-replicas registered before removed from the target group." exit 2 fi -options='R:b:t:i:k:' +options='R:b:t:i:k:m:' while getopts $options option do case $option in b) BEARER_TOKEN=$OPTARG;; i) IMAGE_ID=$OPTARG;; k) KEY_NAME=$OPTARG;; + m) GOOGLE_MAPS_AUTHENTICATION_PARAMS=$OPTARG;; R) RELEASE=$OPTARG;; t) INSTANCE_TYPE=$OPTARG;; \?) echo "Invalid option" @@ -65,6 +67,9 @@ for REGION in $( cat `dirname $0`/regions.txt | grep -v "^#" ); do if [ -n "${INSTANCE_TYPE}" ]; then OPTIONS="${OPTIONS} -t ${INSTANCE_TYPE}" fi + if [ -n "${GOOGLE_MAPS_AUTHENTICATION_PARAMS}" ]; then + OPTIONS="${OPTIONS} -m ${GOOGLE_MAPS_AUTHENTICATION_PARAMS}" + fi echo "Invoking launch-replicas-in-region.sh with options ${OPTIONS}" `dirname $0`/launch-replicas-in-region.sh ${OPTIONS} & echo "Waiting a minute now after having asked for replica launch in region ${REGION} to avoid overloading master with initial load requests" diff --git a/configuration/on-site-scripts/paris2024/launch-replicas-in-region.sh b/configuration/on-site-scripts/paris2024/launch-replicas-in-region.sh index aa649a9f157..3d480607b7f 100755 --- a/configuration/on-site-scripts/paris2024/launch-replicas-in-region.sh +++ b/configuration/on-site-scripts/paris2024/launch-replicas-in-region.sh @@ -8,12 +8,13 @@ TARGET_GROUP_NAME=S-paris2024 COUNT=1 if [ $# -eq 0 ]; then - echo "$0 -g -R -b [-c ] [-r ] [-p :] [-t ] [-i ] [-k ] [-v ]" + echo "$0 -g -R -b -m [-c ] [-r ] [-p :] [-t ] [-i ] [-k ] [-v ]" echo "" echo "-b replication bearer token; mandatory" echo "-c Count; defaults to ${COUNT}" echo "-i Amazon Machine Image (AMI) ID to use to launch the instance; defaults to latest image tagged with image-type:sailing-analytics-server" echo "-g AWS Region, e.g., eu-west-1" + echo "-m Google Maps API key, used for the GOOGLE_MAPS_AUTHENTICATION_PARAMS variable" echo "-k SSH key pair name, mapping to the --key-name parameter; defaults to Axel" echo "-p MongoDB primary host[:port]; defaults to ${REPLICA_SET_PRIMARY}" echo "-r MongoDB replica set name; defaults to ${REPLICA_SET_NAME}" @@ -31,7 +32,7 @@ if [ $# -eq 0 ]; then exit 2 fi -options='g:R:b:c:r:p:t:i:k:v:' +options='g:R:b:c:r:p:t:i:k:v:m:' while getopts $options option do case $option in @@ -40,6 +41,7 @@ do g) REGION=$OPTARG;; i) IMAGE_ID=$OPTARG;; k) KEY_NAME=$OPTARG;; + m) GOOGLE_MAPS_AUTHENTICATION_PARAMS=$OPTARG;; p) REPLICA_SET_PRIMARY=$OPTARG;; R) RELEASE=$OPTARG;; r) REPLICA_SET_NAME=$OPTARG;; @@ -79,6 +81,7 @@ REPLICATE_MASTER_SERVLET_PORT=8888 REPLICATE_MASTER_EXCHANGE_NAME=paris2024 REPLICATE_MASTER_QUEUE_HOST=rabbit-eu-west-3.sapsailing.com REPLICATE_MASTER_BEARER_TOKEN=${BEARER_TOKEN} +GOOGLE_MAPS_AUTHENTICATION_PARAMS=\"${GOOGLE_MAPS_AUTHENTICATION_PARAMS}\" ADDITIONAL_JAVA_ARGS=\"${ADDITIONAL_JAVA_ARGS} -Dcom.sap.sse.debranding=true\"" --ebs-optimized --key-name $KEY_NAME --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=SL Paris2024 (Upgrade Replica)},{Key=sailing-analytics-server,Value=paris2024}]" "ResourceType=volume,Tags=[{Key=Name,Value=SL Paris2024 (Upgrade Replica)}]" | jq -r '.Instances[].PrivateIpAddress + " " + .Instances[].InstanceId' ) EXIT_CODE=$? if [ "${EXIT_CODE}" != "0" ]; then diff --git a/configuration/on-site-scripts/paris2024/upgrade-landscape.sh b/configuration/on-site-scripts/paris2024/upgrade-landscape.sh index 6b1f0896303..7f1c08be6ef 100755 --- a/configuration/on-site-scripts/paris2024/upgrade-landscape.sh +++ b/configuration/on-site-scripts/paris2024/upgrade-landscape.sh @@ -17,16 +17,17 @@ KEY_NAME=Axel INSTANCE_NAME_TO_TERMINATE="SL paris2024 (Auto-Replica)" if [ $# -eq 0 ]; then - echo "$0 -R -b [-t ] [-i ] [-k ] [-s]" + echo "$0 -R -b -m [-t ] [-i ] [-k ] [-s]" echo "" echo "-b replication bearer token; mandatory" echo "-i Amazon Machine Image (AMI) ID to use to launch the instance; defaults to latest image tagged with image-type:sailing-analytics-server" echo "-k Key pair name, mapping to the --key-name parameter; defaults to Axel" + echo "-m Google Maps API key, used for the GOOGLE_MAPS_AUTHENTICATION_PARAMS variable" echo "-R release name; must be provided to select the release, e.g., build-202106040947" echo "-t Instance type; defaults to ${INSTANCE_TYPE}" echo "-s Skip release download" echo - echo "Example: $0 -R build-202106041327 -k Jan" + echo "Example: $0 -R build-202106041327 -k Jan -m key=ABC93480lasdf84398AFFIHSADF93" echo "The procedure works in the following steps:" echo " - patch *.conf files in sap-p1-1:servers/[master|security_service] and sap-p1-2:servers/[secondary_master|master|security_service] so" @@ -43,13 +44,14 @@ if [ $# -eq 0 ]; then echo " named \"${INSTANCE_NAME_TO_TERMINATE}\" are available" exit 2 fi -options='R:b:t:i:k:s' +options='R:b:t:i:k:sm:' while getopts $options option do case $option in b) BEARER_TOKEN=$OPTARG;; i) IMAGE_ID=$OPTARG;; k) KEY_NAME=$OPTARG;; + m) GOOGLE_MAPS_AUTHENTICATION_PARAMS=$OPTARG;; R) RELEASE=$OPTARG;; s) SKIP_DOWNLOAD=1;; t) INSTANCE_TYPE=$OPTARG;; @@ -127,6 +129,9 @@ fi if [ -n "${INSTANCE_TYPE}" ]; then OPTIONS="${OPTIONS} -t ${INSTANCE_TYPE}" fi +if [ -n "${GOOGLE_MAPS_AUTHENTICATION_PARAMS}" ]; then + OPTIONS="${OPTIONS} -m ${GOOGLE_MAPS_AUTHENTICATION_PARAMS}" +fi `dirname $0`/launch-replicas-in-all-regions.sh ${OPTIONS} EXIT_CODE=$? if [ "${EXIT_CODE}" != "0" ]; then