diff --git a/awsconfiguration.sh b/awsconfiguration.sh index 6681569..8d32031 100755 --- a/awsconfiguration.sh +++ b/awsconfiguration.sh @@ -37,5 +37,11 @@ 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 + +if grep -Fxq "awsenvconf" .dockerignore +then + echo "awsenvconf exist in docker ignore file list" +else + echo "awsenvconf" >> .dockerignore +fi diff --git a/buildenv.sh b/buildenv.sh index 9253d16..3d6b91f 100755 --- a/buildenv.sh +++ b/buildenv.sh @@ -33,6 +33,8 @@ download_buildenvfile() do aws s3 cp s3://tc-platform-${ENV_CONFIG}/securitymanager/$listname.json . track_error $? "Environment setting" + jq 'keys[]' $listname.json + track_error $? "$listname.json" done } uploading_buildenvvar() @@ -102,3 +104,10 @@ done ENV_CONFIG=`echo "$ENV" | tr '[:upper:]' '[:lower:]'` download_buildenvfile uploading_buildenvvar + +if grep -Fxq "buildenvvar" .dockerignore +then + log "buildenvvar exist in docker ignore file list" +else + echo "buildenvvar" >> .dockerignore +fi diff --git a/master_deploy.sh b/master_deploy.sh index 0572bdd..c33d30c 100755 --- a/master_deploy.sh +++ b/master_deploy.sh @@ -200,8 +200,9 @@ envaddition() { envname=$1 envvalue=$2 #echo "env value before" $envvalue +set -f template=$(echo $template | jq --arg name "$envname" --arg value "$envvalue" --arg envcount $envcount '.containerDefinitions[0].environment[$envcount |tonumber] |= .+ { name: $name, value: $value }') - +set +f let envcount=envcount+1 #echo "envcount after ---------" $envcount #echo "envvalue after ---------" $envvalue @@ -579,7 +580,7 @@ deploy_s3bucket() { uploadpath=$(echo $syncfilepath | cut -b ${lengthofsearchpath}-) echo $uploadpath getformatdetails=$(file ${syncfilepath}) - if [[ $getformatdetails == *"ASCII"* ]] || [[ $getformatdetails == *"empty"* ]]; + if [[ $getformatdetails == *"ASCII"* ]] || [[ $getformatdetails == *"UTF"* ]] || [[ $getformatdetails == *"empty"* ]]; then echo "file format is ASCII and skipping gzip option" S3_OPTIONS="" @@ -604,6 +605,9 @@ download_envfile() for listname in $Buffer_seclist; do aws s3 cp s3://tc-platform-${ENV_CONFIG}/securitymanager/$listname.json . + track_error $? "$listname.json download" + jq 'keys[]' $listname.json + track_error $? "$listname.json" #cp $HOME/buildscript/securitymanager/$listname.json.enc . #SECPASSWD=$(eval "echo \$${listname}") #openssl enc -aes-256-cbc -d -md MD5 -in $listname.json.enc -out $listname.json -k $SECPASSWD