From 7d938a683e71d34fb6cea193bcf7f257223f5f17 Mon Sep 17 00:00:00 2001 From: Gunasekar K Date: Fri, 8 Feb 2019 23:59:06 +0530 Subject: [PATCH 01/26] aws configuration dynamic --- buildenv.sh | 30 +++++++++++++++--------------- master_deploy.sh | 34 +++++++++++++++++----------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/buildenv.sh b/buildenv.sh index aebb8fc..36c3ef3 100755 --- a/buildenv.sh +++ b/buildenv.sh @@ -84,21 +84,21 @@ do esac done -AWS_ACCESS_KEY_ID=$(eval "echo \$${ENV}_AWS_ACCESS_KEY_ID") -AWS_SECRET_ACCESS_KEY=$(eval "echo \$${ENV}_AWS_SECRET_ACCESS_KEY") -AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION") -if [ -z $AWS_REGION ]; -then -AWS_REGION="us-east-1" -fi -if [ -z $AWS_ACCESS_KEY_ID ] || [ -z $AWS_SECRET_ACCESS_KEY ] ; -then - log "AWS Secret Parameters are not configured in circleci/environment" - usage - exit 1 -else - configure_aws_cli -fi +# AWS_ACCESS_KEY_ID=$(eval "echo \$${ENV}_AWS_ACCESS_KEY_ID") +# AWS_SECRET_ACCESS_KEY=$(eval "echo \$${ENV}_AWS_SECRET_ACCESS_KEY") +# AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION") +# if [ -z $AWS_REGION ]; +# then +# AWS_REGION="us-east-1" +# fi +# if [ -z $AWS_ACCESS_KEY_ID ] || [ -z $AWS_SECRET_ACCESS_KEY ] ; +# then +# log "AWS Secret Parameters are not configured in circleci/environment" +# usage +# exit 1 +# else +# configure_aws_cli +# fi ENV_CONFIG=`echo "$ENV" | tr '[:upper:]' '[:lower:]'` download_buildenvfile uploading_buildenvvar diff --git a/master_deploy.sh b/master_deploy.sh index a6a2a6c..b7756bf 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -10,10 +10,10 @@ SECRET_FILE_NAME="./buildsecvar.conf" SHARED_PROPERTY_FILENAME="" #Common Varibles -AWS_ACCESS_KEY_ID="" -AWS_SECRET_ACCESS_KEY="" -AWS_ACCOUNT_ID="" -AWS_REGION="" +# AWS_ACCESS_KEY_ID="" +# AWS_SECRET_ACCESS_KEY="" +# AWS_ACCOUNT_ID="" +# AWS_REGION="" TAG="" SEC_LIST="" COUNTER_LIMIT=12 @@ -643,19 +643,19 @@ ENV_CONFIG=`echo "$ENV" | tr '[:upper:]' '[:lower:]'` #Getting Deployment varaible only -AWS_ACCESS_KEY_ID=$(eval "echo \$${ENV}_AWS_ACCESS_KEY_ID") -AWS_SECRET_ACCESS_KEY=$(eval "echo \$${ENV}_AWS_SECRET_ACCESS_KEY") -AWS_ACCOUNT_ID=$(eval "echo \$${ENV}_AWS_ACCOUNT_ID") -AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION") -if [ -z $AWS_ACCESS_KEY_ID ] || [ -z $AWS_SECRET_ACCESS_KEY ] || [ -z $AWS_ACCOUNT_ID ] || [ -z $AWS_REGION ]; -then - log "AWS Secret Parameters are not configured in circleci/environment" - usage - exit 1 -else - configure_aws_cli - #aws configure list -fi +# AWS_ACCESS_KEY_ID=$(eval "echo \$${ENV}_AWS_ACCESS_KEY_ID") +# AWS_SECRET_ACCESS_KEY=$(eval "echo \$${ENV}_AWS_SECRET_ACCESS_KEY") +# AWS_ACCOUNT_ID=$(eval "echo \$${ENV}_AWS_ACCOUNT_ID") +# AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION") +# if [ -z $AWS_ACCESS_KEY_ID ] || [ -z $AWS_SECRET_ACCESS_KEY ] || [ -z $AWS_ACCOUNT_ID ] || [ -z $AWS_REGION ]; +# then +# log "AWS Secret Parameters are not configured in circleci/environment" +# usage +# exit 1 +# else +# configure_aws_cli +# #aws configure list +# fi download_envfile #decrypt_fileenc From 9268f51fe326174e98a7a129e2cc7216ce3bcdb4 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Mon, 11 Feb 2019 15:07:30 +0530 Subject: [PATCH 02/26] Update master_deploy.sh --- master_deploy.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/master_deploy.sh b/master_deploy.sh index b7756bf..7674683 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -10,6 +10,7 @@ SECRET_FILE_NAME="./buildsecvar.conf" SHARED_PROPERTY_FILENAME="" #Common Varibles +echo $AWS_ACCESS_KEY_ID # AWS_ACCESS_KEY_ID="" # AWS_SECRET_ACCESS_KEY="" # AWS_ACCOUNT_ID="" From ec4e6436a6dc5a80dd968f02f86d4a35f867d9f5 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Wed, 20 Feb 2019 11:37:41 +0530 Subject: [PATCH 03/26] Update master_deploy.sh --- master_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index 7674683..e649a3b 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -10,7 +10,7 @@ SECRET_FILE_NAME="./buildsecvar.conf" SHARED_PROPERTY_FILENAME="" #Common Varibles -echo $AWS_ACCESS_KEY_ID +#echo $AWS_ACCESS_KEY_ID # AWS_ACCESS_KEY_ID="" # AWS_SECRET_ACCESS_KEY="" # AWS_ACCOUNT_ID="" From 6f90cad1c9621681f76d32c2e34d31789a7d2e3c Mon Sep 17 00:00:00 2001 From: nkumar-topcoder <33625707+nkumar-topcoder@users.noreply.github.com> Date: Wed, 6 Mar 2019 14:40:10 +0530 Subject: [PATCH 04/26] Create sample_ecs_appvar.json --- .../sample_ecs_appvar.json | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 template/variable_file_template/sample_ecs_appvar.json diff --git a/template/variable_file_template/sample_ecs_appvar.json b/template/variable_file_template/sample_ecs_appvar.json new file mode 100644 index 0000000..dfb11a8 --- /dev/null +++ b/template/variable_file_template/sample_ecs_appvar.json @@ -0,0 +1,29 @@ +{ + "API_CONTEXT_PATH": "/v5/somethings", + "AUTH0_AUDIENCE": "https://nm.something.com/", + "AUTH0_CLIENT_ID": "xxxxxx14fbsRx", + "AUTH0_CLIENT_SECRET": "xxxxxx-x-xx", + "AUTH0_URL": "https://something.com.com/oauth/token", + "authSecret": "xxxxxxxx+XCU+x", + "DATABASE_URL": "xxxxxxxxx", + "DEV_MODE_EMAIL": "xxxx.xxxx+devmode@something.com", + "ENABLE_DEV_MODE": "false", + "ENABLE_EMAILS": "true", + "ENV": "DEV", + "KAFKA_CLIENT_CERT": "-----BEGIN CERTIFICATE-----\nxxxxxx\nafSRp9F\n-----END CERTIFICATE-----", + "KAFKA_CLIENT_CERT_KEY": "-----BEGIN RSA PRIVATE KEY-----\nMIIB/8/eg==\n-----END RSA PRIVATE KEY-----", + "KAFKA_GROUP_ID": "tc-something-server", + "KAFKA_URL": "blahblah+ssl://vlab-vlak-01.srvs.blahblah.com:9093", + "LOG_LEVEL": "DEBUG", + "MENTION_EMAIL": "mentioned.connect@something.com", + "MESSAGE_API_BASE_URL": "https://something.com/v5", + "PORT": 4000, + "REPLY_EMAIL_DOMAIN": "connectemail.something.com", + "REPLY_EMAIL_PREFIX": "something", + "TC_API_BASE_URL": "https://something.com", + "TC_API_V3_BASE_URL": "https://something.com/v3", + "TC_API_V4_BASE_URL": "https://something.com/v4", + "TC_API_V5_BASE_URL": "https://something.com/v5\u007f", + "TOKEN_CACHE_TIME": 909090909, + "validIssuers": "[\"https://something.com.com/\",\"https://something.com\",\"https://auth.something.com/\",\"https://auth.something.com/\"]" + } From 8ff62f72ddf8441612bfcc327d59800ee7392fe5 Mon Sep 17 00:00:00 2001 From: nkumar-topcoder <33625707+nkumar-topcoder@users.noreply.github.com> Date: Wed, 6 Mar 2019 14:40:48 +0530 Subject: [PATCH 05/26] Create sample_ecs_deployvar.json --- template/variable_file_template/sample_ecs_deployvar.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 template/variable_file_template/sample_ecs_deployvar.json diff --git a/template/variable_file_template/sample_ecs_deployvar.json b/template/variable_file_template/sample_ecs_deployvar.json new file mode 100644 index 0000000..8cfab17 --- /dev/null +++ b/template/variable_file_template/sample_ecs_deployvar.json @@ -0,0 +1,8 @@ +{ + "AWS_REPOSITORY": "tc-somethings", + "AWS_ECS_CLUSTER": "tc-somethings", + "AWS_ECS_SERVICE": "something-something-svc", + "AWS_ECS_TASK_FAMILY": "tc-somethings-task", + "AWS_ECS_CONTAINER_NAME": "tc-somethings-container", + "AWS_ECS_PORTS": "0:4000:TCP" + } From 7c341a1bb2912da739bf1d8c03d36e23b2c5b747 Mon Sep 17 00:00:00 2001 From: nkumar-topcoder <33625707+nkumar-topcoder@users.noreply.github.com> Date: Mon, 25 Mar 2019 14:50:48 +0530 Subject: [PATCH 06/26] Update master_deploy.sh --- master_deploy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index e649a3b..fbb1e19 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -17,7 +17,11 @@ SHARED_PROPERTY_FILENAME="" # AWS_REGION="" TAG="" SEC_LIST="" -COUNTER_LIMIT=12 +#COUNTER_LIMIT=12 + +if [ -z "$COUNTER_LIMIT" ]; then + COUNTER_LIMIT=12 +fi #Varibles specific to ECS #AWS_REPOSITORY="" From af219461863f4a545f4bb683262314dab88ee87f Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Thu, 11 Apr 2019 17:07:49 +0530 Subject: [PATCH 07/26] Update master_deploy.sh --- master_deploy.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/master_deploy.sh b/master_deploy.sh index fbb1e19..4db64e6 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -214,8 +214,13 @@ template=$(cat $TEMPLATE_SKELETON_FILE) template=$(echo $template | jq --arg family $AWS_ECS_TASK_FAMILY '.family=$family') log "Family updated" -#taskrole and excution role has updated -#template=$(echo $template | jq --arg taskRoleArn arn:aws:iam::$AWS_ACCOUNT_ID:role/ecsTaskExecutionRole '.taskRoleArn=$taskRoleArn') +#taskrole and excution role has updated +if [ -z $AWS_ECS_TASK_ROLE_ARN ]; +then + template=$(echo $template | jq --arg taskRoleArn arn:aws:iam::$AWS_ACCOUNT_ID:role/$$AWS_ECS_TASK_ROLE_ARN '.taskRoleArn=$taskRoleArn') +else + log "No Execution Role defined" +fi #template=$(echo $template | jq --arg executionRoleArn arn:aws:iam::$AWS_ACCOUNT_ID:role/ecsTaskExecutionRole '.executionRoleArn=$executionRoleArn') #Container Name update From 66a0efd2737f4144c2716e4095d9f34a31634616 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Thu, 11 Apr 2019 17:12:16 +0530 Subject: [PATCH 08/26] Update master_deploy.sh --- master_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index 4db64e6..0e45b1c 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -217,7 +217,7 @@ log "Family updated" #taskrole and excution role has updated if [ -z $AWS_ECS_TASK_ROLE_ARN ]; then - template=$(echo $template | jq --arg taskRoleArn arn:aws:iam::$AWS_ACCOUNT_ID:role/$$AWS_ECS_TASK_ROLE_ARN '.taskRoleArn=$taskRoleArn') + template=$(echo $template | jq --arg taskRoleArn arn:aws:iam::$AWS_ACCOUNT_ID:role/$AWS_ECS_TASK_ROLE_ARN '.taskRoleArn=$taskRoleArn') else log "No Execution Role defined" fi From 19ce6a9acaf0688433823f191bba101d04b8ce37 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Thu, 11 Apr 2019 17:13:42 +0530 Subject: [PATCH 09/26] Update master_deploy.sh --- master_deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/master_deploy.sh b/master_deploy.sh index 0e45b1c..30a9d84 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -217,9 +217,9 @@ log "Family updated" #taskrole and excution role has updated if [ -z $AWS_ECS_TASK_ROLE_ARN ]; then - template=$(echo $template | jq --arg taskRoleArn arn:aws:iam::$AWS_ACCOUNT_ID:role/$AWS_ECS_TASK_ROLE_ARN '.taskRoleArn=$taskRoleArn') -else log "No Execution Role defined" +else + template=$(echo $template | jq --arg taskRoleArn arn:aws:iam::$AWS_ACCOUNT_ID:role/$AWS_ECS_TASK_ROLE_ARN '.taskRoleArn=$taskRoleArn') fi #template=$(echo $template | jq --arg executionRoleArn arn:aws:iam::$AWS_ACCOUNT_ID:role/ecsTaskExecutionRole '.executionRoleArn=$executionRoleArn') From a0bbcb95d999a12f13ba201429c85dc52aac38b7 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Wed, 24 Apr 2019 17:19:34 +0530 Subject: [PATCH 10/26] Update master_deploy.sh --- master_deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/master_deploy.sh b/master_deploy.sh index 30a9d84..ac1aed4 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -65,8 +65,8 @@ EBS_TEMPLATE_FILE_NAME="" CFCACHE="true" #variable for Lambda -AWS_LAMBDA_DEPLOY_TYPE="" -AWS_LAMBDA_STAGE="" +#AWS_LAMBDA_DEPLOY_TYPE="" +#AWS_LAMBDA_STAGE="" #FUNCTIONS #usage Function - provides information like how to execute the script From 2ae87e8507b014473c31ce5ba6e28c73f4b7a668 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Wed, 24 Apr 2019 17:36:03 +0530 Subject: [PATCH 11/26] Update master_deploy.sh --- master_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index ac1aed4..22f638a 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -579,7 +579,7 @@ deploy_lambda_package() if [ "$AWS_LAMBDA_DEPLOY_TYPE" == "SLS" ] then echo "welcome to lambda SLS deploy" - sls deploy --stage $AWS_LAMBDA_STAGE + sudo sls deploy --stage $AWS_LAMBDA_STAGE fi From 0b0a44c3dc44cbadfa26526a9c67d9dc59599515 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Wed, 24 Apr 2019 17:41:12 +0530 Subject: [PATCH 12/26] Update master_deploy.sh --- master_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index 22f638a..ac1aed4 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -579,7 +579,7 @@ deploy_lambda_package() if [ "$AWS_LAMBDA_DEPLOY_TYPE" == "SLS" ] then echo "welcome to lambda SLS deploy" - sudo sls deploy --stage $AWS_LAMBDA_STAGE + sls deploy --stage $AWS_LAMBDA_STAGE fi From fb4f900a2d1e5916f88d1a665905dbeb9c6589dc Mon Sep 17 00:00:00 2001 From: nkumar-topcoder <33625707+nkumar-topcoder@users.noreply.github.com> Date: Wed, 24 Apr 2019 17:52:23 +0530 Subject: [PATCH 13/26] Update master_deploy.sh --- master_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index ac1aed4..b55a63c 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -579,7 +579,7 @@ deploy_lambda_package() if [ "$AWS_LAMBDA_DEPLOY_TYPE" == "SLS" ] then echo "welcome to lambda SLS deploy" - sls deploy --stage $AWS_LAMBDA_STAGE + sls deploy --force --stage $AWS_LAMBDA_STAGE fi From 246d277442f9eb2ad851878b13be8db97db36ff3 Mon Sep 17 00:00:00 2001 From: nkumar-topcoder <33625707+nkumar-topcoder@users.noreply.github.com> Date: Wed, 24 Apr 2019 17:54:10 +0530 Subject: [PATCH 14/26] Update master_deploy.sh --- master_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index b55a63c..ac1aed4 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -579,7 +579,7 @@ deploy_lambda_package() if [ "$AWS_LAMBDA_DEPLOY_TYPE" == "SLS" ] then echo "welcome to lambda SLS deploy" - sls deploy --force --stage $AWS_LAMBDA_STAGE + sls deploy --stage $AWS_LAMBDA_STAGE fi From 9bb0231f0bb30688cc566129c8fc73ccbced8395 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Fri, 3 May 2019 15:35:54 +0530 Subject: [PATCH 15/26] authentication bug fix for ebs --- ebs_base_template_v2.json.template | 14 ++++++++++++++ master_deploy.sh | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 ebs_base_template_v2.json.template diff --git a/ebs_base_template_v2.json.template b/ebs_base_template_v2.json.template new file mode 100644 index 0000000..86b14be --- /dev/null +++ b/ebs_base_template_v2.json.template @@ -0,0 +1,14 @@ +{ + "AWSEBDockerrunVersion": "1", + "Authentication": { + "Bucket": "@AWSS3AUTHBUCKET@", + "Key": "services/common/dockercfg" + }, + "Image": { + "Name": "appiriodevops/@IMAGE@", + "Update": "true" + }, + "Ports": [], + "Volumes": [], + "Logging": "" +} \ No newline at end of file diff --git a/master_deploy.sh b/master_deploy.sh index ac1aed4..e1d0d93 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -45,7 +45,7 @@ APP_IMAGE_NAME="" DOCKERRUN="Dockerrun.aws.json" #EBS_EB_EXTENSTION_LOCATION="" IMG_WITH_EBS_TAG="" -EBS_TEMPLATE_SKELETON_FILE="ebs_base_template_v1.json.template" +EBS_TEMPLATE_SKELETON_FILE="ebs_base_template_v2.json.template" EBS_APPLICATION_NAME="" EBS_APPVER="" EBS_TAG="" @@ -429,6 +429,9 @@ track_error $? "docker push failed." } creating_updating_ebs_docker_json() { + echo "updating auth bucket name" + sed -i.bak -e "s/@AWSS3AUTHBUCKET@/appirio-platform-$ENV_CONFIG/g" $EBS_TEMPLATE_SKELETON_FILE + rm ${EBS_TEMPLATE_SKELETON_FILE}.bak if [ -z "$EBS_EB_EXTENSTION_LOCATION" ]; then From e493cc24f4a2baea4f9f6c6697b4036e63028e13 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Fri, 3 May 2019 15:38:37 +0530 Subject: [PATCH 16/26] authentication bug fix for ebs --- ebs_base_template_v2.json.template | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ebs_base_template_v2.json.template b/ebs_base_template_v2.json.template index 86b14be..85bc8f1 100644 --- a/ebs_base_template_v2.json.template +++ b/ebs_base_template_v2.json.template @@ -8,7 +8,9 @@ "Name": "appiriodevops/@IMAGE@", "Update": "true" }, - "Ports": [], + "Ports": [{ + "ContainerPort": "8080" + }], "Volumes": [], "Logging": "" } \ No newline at end of file From 99b19addee48717a1b254df1b64bdad7cc1c7bb7 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Tue, 7 May 2019 21:08:49 +0530 Subject: [PATCH 17/26] EBS port mapping --- ebs_base_template_v2.json.template | 4 +-- ebs_base_template_v3.json.template | 15 +++++++++++ master_deploy.sh | 41 ++++++++++++++++++++++++++++-- 3 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 ebs_base_template_v3.json.template diff --git a/ebs_base_template_v2.json.template b/ebs_base_template_v2.json.template index 85bc8f1..86b14be 100644 --- a/ebs_base_template_v2.json.template +++ b/ebs_base_template_v2.json.template @@ -8,9 +8,7 @@ "Name": "appiriodevops/@IMAGE@", "Update": "true" }, - "Ports": [{ - "ContainerPort": "8080" - }], + "Ports": [], "Volumes": [], "Logging": "" } \ No newline at end of file diff --git a/ebs_base_template_v3.json.template b/ebs_base_template_v3.json.template new file mode 100644 index 0000000..2af6938 --- /dev/null +++ b/ebs_base_template_v3.json.template @@ -0,0 +1,15 @@ +{ + "AWSEBDockerrunVersion": "1", + "Authentication": { + "Bucket": "@AWSS3AUTHBUCKET@", + "Key": "services/common/dockercfg" + }, + "Image": { + "Name": "appiriodevops/@IMAGE@", + "Update": "true" + }, + "Ports": [ + ], + "Volumes": [], + "Logging": "" +} diff --git a/master_deploy.sh b/master_deploy.sh index e1d0d93..69891f0 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -45,7 +45,7 @@ APP_IMAGE_NAME="" DOCKERRUN="Dockerrun.aws.json" #EBS_EB_EXTENSTION_LOCATION="" IMG_WITH_EBS_TAG="" -EBS_TEMPLATE_SKELETON_FILE="ebs_base_template_v2.json.template" +EBS_TEMPLATE_SKELETON_FILE="ebs_base_template_v3.json.template" EBS_APPLICATION_NAME="" EBS_APPVER="" EBS_TAG="" @@ -58,7 +58,8 @@ EBS_TEMPLATE_FILE_NAME="" #AWS_EBS_EB_DOCKERRUN_TEMPLATE_LOCATION=$(eval "echo \$${ENV}_AWS_EBS_EB_DOCKERRUN_TEMPLATE_LOCATION") #AWS_EBS_DOCKERRUN_TEMPLATE=$(eval "echo \$${ENV}_AWS_EBS_DOCKERRUN_TEMPLATE") #AWS_S3_KEY_LOCATION="" - +ebsportcount=0 +ebstemplate="" #variable for cloud front #AWS_S3_BUCKET="" #AWS_S3_SOURCE_SYNC_PATH="" @@ -418,6 +419,22 @@ validate_update_loggroup() } # EBS integration +ebsportmapping() { +echo "port map called" +containerport=$1 +hostport=$2 + +if [ -z $hostport ] +then +ebstemplate=$(echo $ebstemplate | jq --arg containerPort $containerport --arg ebsportcount $ebsportcount '.Ports[$ebsportcount |tonumber] |= .+ { ContainerPort: $containerPort }') +else +ebstemplate=$(echo $ebstemplate | jq --arg hostPort $hostport --arg containerPort $containerport --arg ebsportcount $ebsportcount '.Ports[$ebsportcount |tonumber] |= .+ { HostPort: $hostPort, ContainerPort: $containerPort }') +fi + +let ebsportcount=ebsportcount+1 + +} + EBS_push_docker_image() { @@ -433,6 +450,26 @@ creating_updating_ebs_docker_json() { sed -i.bak -e "s/@AWSS3AUTHBUCKET@/appirio-platform-$ENV_CONFIG/g" $EBS_TEMPLATE_SKELETON_FILE rm ${EBS_TEMPLATE_SKELETON_FILE}.bak + #EBS Port Mapping + ebstemplate=$(cat $EBS_TEMPLATE_SKELETON_FILE) + if [ -z $AWS_EBS_PORTS ]; + then + echo "No container port is defined. configuring default 8080 port" + ebsportmapping 8080 + else + Buffer_portmap=$(echo $AWS_EBS_PORTS | sed 's/,/ /g') + for ebsportbuf in $Buffer_portmap; + do + containerport=$( echo $ebsportbuf | cut -d ':' -f 1 ) + if [[ $ebsportbuf = *:* ]]; then + hostport=$( echo $ebsportbuf | cut -d ':' -f 2 ) + fi + ebsportmapping $containerport $hostport + done + fi + echo "$ebstemplate" > $EBS_TEMPLATE_SKELETON_FILE + log "port mapping updated" + if [ -z "$EBS_EB_EXTENSTION_LOCATION" ]; then cat $EBS_TEMPLATE_SKELETON_FILE | sed -e "s/@IMAGE@/${IMG_WITH_EBS_TAG}/g" > $DOCKERRUN From c245abcab55766cddab65b32118b4cc85cea742e Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Wed, 8 May 2019 10:31:35 +0530 Subject: [PATCH 18/26] EBS port mapping --- ebs_base_template_v2.json.template | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ebs_base_template_v2.json.template b/ebs_base_template_v2.json.template index 86b14be..85bc8f1 100644 --- a/ebs_base_template_v2.json.template +++ b/ebs_base_template_v2.json.template @@ -8,7 +8,9 @@ "Name": "appiriodevops/@IMAGE@", "Update": "true" }, - "Ports": [], + "Ports": [{ + "ContainerPort": "8080" + }], "Volumes": [], "Logging": "" } \ No newline at end of file From 5ffc6a69926708f4d1e9924fe970f0908c873dd0 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Thu, 16 May 2019 08:11:21 +0530 Subject: [PATCH 19/26] ECS CLI integration --- master_deploy.sh | 166 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 135 insertions(+), 31 deletions(-) diff --git a/master_deploy.sh b/master_deploy.sh index 69891f0..f34435b 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -40,6 +40,7 @@ volcount=0 template="" TEMPLATE_SKELETON_FILE="base_template_v2.json" APP_IMAGE_NAME="" +DEPLOYCATEGORY="" #variable specific to EBS DOCKERRUN="Dockerrun.aws.json" @@ -140,7 +141,24 @@ ECS_push_ecr_image() { track_error $? "ECS ECR image push" log "Docker Image published." } - +#=============== +ECSCLI_push_ecr_image() { + ECS_REPONAME=$1 + IMAGE_NAME=$2 + if [ -z "$IMAGE_NAME" ]; + then + log "Image has followed standard format" + else + log "Image does not follow stanard format. Modifying the image and updating the ECS_TAG" + docker tag $IMAGE_NAME:$ECS_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECS_REPONAME:$CIRCLE_BUILD_NUM + ECS_TAG=$CIRCLE_BUILD_NUM + fi + log "Pushing Docker Image..." + eval $(aws ecr get-login --region $AWS_REGION --no-include-email) + docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECS_REPONAME:$ECS_TAG + track_error $? "ECS ECR image push" + log "Docker Image published." +} #================ portmapping() { hostport=$1 @@ -667,7 +685,9 @@ do g) SHARED_PROPERTY_FILENAME=$OPTARG ;; - + m) + DEPLOYCATEGORY=$OPTARG + ;; ?) log "additional param required" usage @@ -719,14 +739,26 @@ download_envfile if [ "$DEPLOYMENT_TYPE" == "ECS" ] then ECS_TAG=$TAG - cp $HOME/buildscript/$TEMPLATE_SKELETON_FILE . + if [ "$DEPLOYCATEGORY" == "CLI" ] + then + if [ -z $AWS_REPOSITORY ] || [ -z $AWS_ECS_CLUSTER ] || [ -z $AWS_ECS_SERVICE ] || [ -z $ECS_TAG ]; + then + log "Deployment varibale are not updated. Please check tag option has provided. also ensure AWS_REPOSITORY, AWS_ECS_TASK_FAMILY,AWS_ECS_CONTAINER_NAME,AWS_ECS_PORTS,AWS_ECS_CLUSTER and AWS_ECS_SERVICE ariables are configured on secret manager" + usage + exit 1 + fi + DEPLOYCATEGORYNAME="ECSCLI" + else + cp $HOME/buildscript/$TEMPLATE_SKELETON_FILE . - if [ -z $AWS_REPOSITORY ] || [ -z $AWS_ECS_CLUSTER ] || [ -z $AWS_ECS_SERVICE ] || [ -z $AWS_ECS_TASK_FAMILY ] || [ -z $AWS_ECS_CONTAINER_NAME ] || [ -z $AWS_ECS_PORTS ] || [ -z $ECS_TAG ]; - then - log "Deployment varibale are not updated. Please check tag option has provided. also ensure AWS_REPOSITORY, AWS_ECS_TASK_FAMILY,AWS_ECS_CONTAINER_NAME,AWS_ECS_PORTS,AWS_ECS_CLUSTER and AWS_ECS_SERVICE ariables are configured on secret manager" - usage - exit 1 - fi + if [ -z $AWS_REPOSITORY ] || [ -z $AWS_ECS_CLUSTER ] || [ -z $AWS_ECS_SERVICE ] || [ -z $AWS_ECS_TASK_FAMILY ] || [ -z $AWS_ECS_CONTAINER_NAME ] || [ -z $AWS_ECS_PORTS ] || [ -z $ECS_TAG ]; + then + log "Deployment varibale are not updated. Please check tag option has provided. also ensure AWS_REPOSITORY, AWS_ECS_TASK_FAMILY,AWS_ECS_CONTAINER_NAME,AWS_ECS_PORTS,AWS_ECS_CLUSTER and AWS_ECS_SERVICE ariables are configured on secret manager" + usage + exit 1 + fi + DEPLOYCATEGORYNAME="AWSCLI" + fi log "AWS_REPOSITORY : $AWS_REPOSITORY" log "AWS_ECS_CLUSTER : $AWS_ECS_CLUSTER" log "AWS_ECS_SERVICE_NAMES : $AWS_ECS_SERVICE" @@ -734,6 +766,7 @@ then log "AWS_ECS_CONTAINER_NAME : $AWS_ECS_CONTAINER_NAME" log "AWS_ECS_PORTS : $AWS_ECS_PORTS" log "ECS_TAG : $ECS_TAG" + log "DEPLOY TYPE : $DEPLOYCATEGORYNAME" fi #EBS parameter validation if [ "$DEPLOYMENT_TYPE" == "EBS" ] @@ -811,29 +844,100 @@ input_parsing_validation $@ if [ "$DEPLOYMENT_TYPE" == "ECS" ] then - validate_update_loggroup - ECS_push_ecr_image - ECS_template_create_register - echo "value of AWS_ECS_SERVICE " $AWS_ECS_SERVICE - AWS_ECS_SERVICE_NAMES=$(echo ${AWS_ECS_SERVICE} | sed 's/,/ /g') - #AWS_ECS_SERVICE_NAMES=$(echo ${AWS_ECS_SERVICE} | sed 's/,/ /g' | sed 'N;s/\n//') - echo "value of AWS_ECS_SERVICE_NAMES " $AWS_ECS_SERVICE_NAMES - IFS=' ' read -a AWS_ECS_SERVICES <<< $AWS_ECS_SERVICE_NAMES - if [ ${#AWS_ECS_SERVICES[@]} -gt 0 ]; then - echo "${#AWS_ECS_SERVICES[@]} service are going to be updated" - for AWS_ECS_SERVICE_NAME in "${AWS_ECS_SERVICES[@]}" - do - echo "updating ECS Cluster Service - $AWS_ECS_SERVICE_NAME" - ECS_deploy_cluster "$AWS_ECS_SERVICE_NAME" - check_service_status "$AWS_ECS_SERVICE_NAME" - #echo $REVISION - done - else - echo "Kindly check the service name in Parameter" - usage - exit 1 + if [ "$DEPLOYCATEGORY" == "CLI" ] + then + eval $(aws ecr get-login --region $AWS_REGION --no-include-email) + #Moving image to repository + if [ -z $APP_IMAGE_NAME ]; + then + echo "value of AWS_REPOSITORY " $AWS_REPOSITORY + AWS_REPOSITORY_NAMES=$(echo ${AWS_REPOSITORY} | sed 's/,/ /g') + echo "value of AWS_REPOSITORY_NAMES " $AWS_REPOSITORY_NAMES + IFS=' ' read -a AWS_REPOSITORY_NAMES_ARRAY <<< $AWS_REPOSITORY_NAMES + if [ ${#AWS_REPOSITORY_NAMES_ARRAY[@]} -gt 0 ]; then + echo "${#AWS_REPOSITORY_NAMES_ARRAY[@]} repo push initalisation" + for AWS_ECS_REPO_NAME in "${AWS_REPOSITORY_NAMES_ARRAY[@]}" + do + echo "updating reposioty - $AWS_ECS_REPO_NAME" + ECSCLI_push_ecr_image $AWS_ECS_REPO_NAME + #echo $REVISION + done + else + echo "Kindly check the Repository name has Parameter" + usage + exit 1 + fi + else + #if appp images details are provided + + echo "value of AWS_REPOSITORY " $AWS_REPOSITORY + AWS_REPOSITORY_NAMES=$(echo ${AWS_REPOSITORY} | sed 's/,/ /g') + echo "value of AWS_REPOSITORY_NAMES " $AWS_REPOSITORY_NAMES + echo "value of image name provided " $APP_IMAGE_NAME + APP_IMAGE_NAMES=$(echo ${APP_IMAGE_NAME} | sed 's/,/ /g') + IFS=' ' read -a AWS_REPOSITORY_NAMES_ARRAY <<< $AWS_REPOSITORY_NAMES + IFS=' ' read -a APP_IMAGE_NAMES_ARRAY <<< $APP_IMAGE_NAMES + echo "AWS REPO COUNT NEED TO BE UPDATE ${#AWS_REPOSITORY_NAMES_ARRAY[@]} , APP image count provided in option ${#APP_IMAGE_NAMES_ARRAY[@]} " + if [ "${#AWS_REPOSITORY_NAMES_ARRAY[@]}" = "${#APP_IMAGE_NAMES_ARRAY[@]}" ]; + then + ecstempcount=0 + while [ $ecstempcount -lt ${#AWS_REPOSITORY_NAMES_ARRAY[@]} ] + do + echo "${AWS_REPOSITORY_NAMES_ARRAY[$count]} , ${APP_IMAGE_NAMES_ARRAY[$count]}" + ECSCLI_push_ecr_image "${AWS_REPOSITORY_NAMES_ARRAY[$count]}" "${APP_IMAGE_NAMES_ARRAY[$count]}" + ecstempcount=`expr $ecstempcount + 1` + done + else + echo "Kindly check the image name in Parameter" + usage + exit 1 + fi + fi + # Configurong cluster + ecs-cli configure --region us-east-1 --cluster $AWS_ECS_CLUSTER + # updating service + echo "value of AWS_ECS_SERVICE " $AWS_ECS_SERVICE + AWS_ECS_SERVICE_NAMES=$(echo ${AWS_ECS_SERVICE} | sed 's/,/ /g') + #AWS_ECS_SERVICE_NAMES=$(echo ${AWS_ECS_SERVICE} | sed 's/,/ /g' | sed 'N;s/\n//') + echo "value of AWS_ECS_SERVICE_NAMES " $AWS_ECS_SERVICE_NAMES + IFS=' ' read -a AWS_ECS_SERVICES <<< $AWS_ECS_SERVICE_NAMES + if [ ${#AWS_ECS_SERVICES[@]} -gt 0 ]; then + echo "${#AWS_ECS_SERVICES[@]} service are going to be updated" + for AWS_ECS_SERVICE_NAME in "${AWS_ECS_SERVICES[@]}" + do + echo "updating ECS Cluster Service - $AWS_ECS_SERVICE_NAME" + ecs-cli compose --project-name "$AWS_ECS_SERVICE_NAME" service up + #echo $REVISION + done + else + echo "Kindly check the service name in Parameter" + usage + exit 1 + fi + else + validate_update_loggroup + ECS_push_ecr_image + ECS_template_create_register + echo "value of AWS_ECS_SERVICE " $AWS_ECS_SERVICE + AWS_ECS_SERVICE_NAMES=$(echo ${AWS_ECS_SERVICE} | sed 's/,/ /g') + #AWS_ECS_SERVICE_NAMES=$(echo ${AWS_ECS_SERVICE} | sed 's/,/ /g' | sed 'N;s/\n//') + echo "value of AWS_ECS_SERVICE_NAMES " $AWS_ECS_SERVICE_NAMES + IFS=' ' read -a AWS_ECS_SERVICES <<< $AWS_ECS_SERVICE_NAMES + if [ ${#AWS_ECS_SERVICES[@]} -gt 0 ]; then + echo "${#AWS_ECS_SERVICES[@]} service are going to be updated" + for AWS_ECS_SERVICE_NAME in "${AWS_ECS_SERVICES[@]}" + do + echo "updating ECS Cluster Service - $AWS_ECS_SERVICE_NAME" + ECS_deploy_cluster "$AWS_ECS_SERVICE_NAME" + check_service_status "$AWS_ECS_SERVICE_NAME" + #echo $REVISION + done + else + echo "Kindly check the service name in Parameter" + usage + exit 1 + fi fi - fi From 34c52cdabda38974eb892e95ca8df92a75c312e8 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Thu, 16 May 2019 14:33:22 +0530 Subject: [PATCH 20/26] Option Bug fixed --- master_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index f34435b..b8d93d5 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -651,7 +651,7 @@ deploy_lambda_package() # Input Collection and validation input_parsing_validation() { -while getopts .d:h:i:e:t:v:s:p:g:c:. OPTION +while getopts .d:h:i:e:t:v:s:p:g:c:m:. OPTION do case $OPTION in d) From 08199d9dc059ac18ac39c65b151a31baf44cf08d Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Thu, 16 May 2019 15:25:23 +0530 Subject: [PATCH 21/26] environment configuration for ecscli --- master_deploy.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/master_deploy.sh b/master_deploy.sh index b8d93d5..f834337 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -41,6 +41,7 @@ template="" TEMPLATE_SKELETON_FILE="base_template_v2.json" APP_IMAGE_NAME="" DEPLOYCATEGORY="" +ECSCLI_ENVFILE="api.env" #variable specific to EBS DOCKERRUN="Dockerrun.aws.json" @@ -160,6 +161,27 @@ ECSCLI_push_ecr_image() { log "Docker Image published." } #================ +ECSCLI_update_env() +{ + Buffer_seclist=$(echo $SEC_LIST | sed 's/,/ /g') + for listname in $Buffer_seclist; + do + local o=$IFS + IFS=$(echo -en "\n\b") + envvars=$( cat $listname.json | jq -r ' . ' | jq ' . | to_entries[] | { "name": .key , "value": .value } ' | jq -s . ) + log "vars are fetched" + + for s in $(echo $envvars | jq -c ".[]" ); do + #echo $envvars + varname=$(echo $s| jq -r ".name") + varvalue=$(echo $s| jq -r ".value") + envaddition "$varname" "$varvalue" + echo "$varname"="\"$varvalue\"" >>$ECSCLI_ENVFILE + done + IFS=$o + done +} +#================ portmapping() { hostport=$1 containerport=$2 @@ -893,6 +915,8 @@ then exit 1 fi fi + #env file updation + ECSCLI_update_env # Configurong cluster ecs-cli configure --region us-east-1 --cluster $AWS_ECS_CLUSTER # updating service From ed32eaf0e691d14e103e0a6a30b159660621dc96 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Mon, 29 Jul 2019 17:11:17 +0530 Subject: [PATCH 22/26] AWS_ECS_CONTAINER_CPU has added globally to fix the bug --- master_deploy.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/master_deploy.sh b/master_deploy.sh index f834337..45f34a0 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -283,6 +283,16 @@ else fi log "Memory reservation updated" +#Container Memory reservation +if [ -z $AWS_ECS_CONTAINER_CPU ]; +then + echo "No cpu defined . Going with default value 100" + AWS_ECS_CONTAINER_CPU=100 + template=$(echo $template | jq --argjson cpu $AWS_ECS_CONTAINER_CPU '.containerDefinitions[0].cpu=$cpu') +else + template=$(echo $template | jq --argjson cpu $AWS_ECS_CONTAINER_CPU '.containerDefinitions[0].cpu=$cpu') +fi + #Port Mapping Buffer_portmap=$(echo $AWS_ECS_PORTS | sed 's/,/ /g') for b1 in $Buffer_portmap; @@ -379,15 +389,6 @@ else #CONTAINER_CPU ECS_NETWORKTYPE="bridge" template=$(echo $template | jq --arg networkMode $ECS_NETWORKTYPE '.networkMode=$networkMode') - #Container Memory reservation - if [ -z $AWS_ECS_CONTAINER_CPU ]; - then - echo "No cpu defined . Going with default value 100" - AWS_ECS_CONTAINER_CPU=100 - template=$(echo $template | jq --argjson cpu $AWS_ECS_CONTAINER_CPU '.containerDefinitions[0].cpu=$cpu') - else - template=$(echo $template | jq --argjson cpu $AWS_ECS_CONTAINER_CPU '.containerDefinitions[0].cpu=$cpu') - fi # Updating the compatibiltiy template=$(echo $template | jq --arg requiresCompatibilities EC2 '.requiresCompatibilities[0] = $requiresCompatibilities') From aa4cc51eeeb59c9f6c9e9611ec8192739f2b999b Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Mon, 7 Oct 2019 20:49:08 +0530 Subject: [PATCH 23/26] Update buildenv.sh --- buildenv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildenv.sh b/buildenv.sh index 36c3ef3..9253d16 100755 --- a/buildenv.sh +++ b/buildenv.sh @@ -48,7 +48,7 @@ uploading_buildenvvar() varname=$(echo $s| jq -r ".name") varvalue=$(echo $s| jq -r ".value") echo $varname - echo export "$varname"="\"$varvalue\"" >>"buildenvvar" + echo export "$varname"="'$varvalue'" >>"buildenvvar" #export "$varname"="$varvalue" #echo export "$varname"="$varvalue" >>"$BASH_ENV" #echo export "$varname"="\"$varvalue\"" >> ~/.circlerc From 6ee88c686d32a7eaba172c014995e98cd5e74962 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Tue, 27 Oct 2020 18:04:40 +0530 Subject: [PATCH 24/26] code changed --- master_deploy.sh | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/master_deploy.sh b/master_deploy.sh index 45f34a0..5f8c388 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -569,16 +569,34 @@ deploy_s3bucket() { exit 1 fi - S3_OPTIONS="--exclude '*' --include '*.txt' --include '*.js' --include '*.css' --content-encoding gzip" - echo aws s3 sync --dryrun $AWS_S3_SOURCE_SYNC_PATH s3://${AWS_S3_BUCKET} ${S3_CACHE_OPTIONS} ${S3_OPTIONS} - eval "aws s3 sync --dryrun $AWS_S3_SOURCE_SYNC_PATH s3://${AWS_S3_BUCKET} ${S3_CACHE_OPTIONS} ${S3_OPTIONS}" - result=`eval "aws s3 sync $AWS_S3_SOURCE_SYNC_PATH s3://${AWS_S3_BUCKET} ${S3_CACHE_OPTIONS} ${S3_OPTIONS}"` - if [ $? -eq 0 ]; then - echo "All txt, css, and js files are Deployed! with gzip" - else - echo "Deployment Failed - $result" - exit 1 - fi + # S3_OPTIONS="--exclude '*' --include '*.txt' --include '*.js' --include '*.css' --content-encoding gzip" + searchpath=${AWS_S3_SOURCE_SYNC_PATH} + lengthofsearchpath=$(echo ${#searchpath}) + lengthofsearchpath=$((lengthofsearchpath+1)) + for syncfilepath in $(find ${searchpath} -name '*.js' -o -name '*.txt' -o -name '*.css'); + do + echo "$syncfilepath" + uploadpath=$(echo $syncfilepath | cut -b ${lengthofsearchpath}-) + echo $uploadpath + getformatdetails=$(file ${syncfilepath}) + if [[ $getformatdetails == *"ASCII"* ]] || [[ $getformatdetails == *"empty"* ]]; + then + echo "file format is ASCII adn skipping gzip option" + S3_OPTIONS="" + else + echo $getformatdetails + S3_OPTIONS="--content-encoding gzip" + fi + echo aws s3 cp --dryrun $syncfilepath s3://${AWS_S3_BUCKET}${uploadpath} ${S3_CACHE_OPTIONS} ${S3_OPTIONS} + eval "aws s3 cp --dryrun $syncfilepath s3://${AWS_S3_BUCKET}${uploadpath} ${S3_CACHE_OPTIONS} ${S3_OPTIONS}" + result=`eval "aws s3 cp $syncfilepath s3://${AWS_S3_BUCKET}${uploadpath} ${S3_CACHE_OPTIONS} ${S3_OPTIONS}"` + if [ $? -eq 0 ]; then + echo "file Deployed!" + else + echo "Deployment Failed - $result" + exit 1 + fi + done; } download_envfile() { From 4304578cc4fe7b481625ff22d144fbe55bea76d1 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Wed, 28 Oct 2020 11:06:16 +0530 Subject: [PATCH 25/26] Update master_deploy.sh --- master_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/master_deploy.sh b/master_deploy.sh index 5f8c388..0572bdd 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -581,7 +581,7 @@ deploy_s3bucket() { getformatdetails=$(file ${syncfilepath}) if [[ $getformatdetails == *"ASCII"* ]] || [[ $getformatdetails == *"empty"* ]]; then - echo "file format is ASCII adn skipping gzip option" + echo "file format is ASCII and skipping gzip option" S3_OPTIONS="" else echo $getformatdetails From 4f3d41ae563631b829fbda8fc5635a3188ec1228 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Tue, 9 Mar 2021 19:49:24 +0530 Subject: [PATCH 26/26] Update awsconfiguration.sh ignore awsenvconf file --- awsconfiguration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awsconfiguration.sh b/awsconfiguration.sh index 4b8d3bf..6681569 100755 --- a/awsconfiguration.sh +++ b/awsconfiguration.sh @@ -37,5 +37,5 @@ echo "export AWS_SECRET_ACCESS_KEY=\"$AWS_SECRET_ACCESS_KEY\"">>awsenvconf echo "export AWS_ENVIRONMENT=\"$AWS_ENVIRONMENT\"">>awsenvconf echo "export AWS_SESSION_TOKEN=\"$AWS_SESSION_TOKEN\"">>awsenvconf echo "export AWS_ACCOUNT_ID=\"$AWS_ACCOUNT_ID\"">>awsenvconf - +echo awsenvconf >>.dockerignore