From 6696e3bbf108561a9f0e829642eff011ec9699c4 Mon Sep 17 00:00:00 2001 From: Xavier Metichecchia Date: Mon, 21 Oct 2024 14:52:53 -0400 Subject: [PATCH 01/10] PXBF-main: Reset tome scripts to main URI without 1 --- scripts/application/bf-tome-run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/application/bf-tome-run.sh b/scripts/application/bf-tome-run.sh index 9025f9c1..ab42134d 100755 --- a/scripts/application/bf-tome-run.sh +++ b/scripts/application/bf-tome-run.sh @@ -5,6 +5,7 @@ SCRIPT_NAME=$(basename "$0") SCRIPT_PID=$$ URI=${1:-https://bf-static-main.bxdev.net} +URI=https://bf-static-main.bxdev.net # URI=https://bf-static-dev.bxdev.net FORCE=${2:-0} RETRY_SEMAPHORE_FILE=/tmp/tome-log/retry-on-next-run From 0011e39eb0704eea84f64d1ede5045154c73e4d6 Mon Sep 17 00:00:00 2001 From: Xavier Metichecchia Date: Mon, 21 Oct 2024 14:53:20 -0400 Subject: [PATCH 02/10] PXBF-main: Reset tome scripts to main URI without 1 --- scripts/application/bf-tome-static.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/application/bf-tome-static.sh b/scripts/application/bf-tome-static.sh index a53fa2bc..678cf2ca 100755 --- a/scripts/application/bf-tome-static.sh +++ b/scripts/application/bf-tome-static.sh @@ -2,7 +2,8 @@ set -x # URI=https://bf-static-dev.bxdev.net -URI=${1:-https://bf-static-main.bxdev.net} +# URI=${1:-https://bf-static-main.bxdev.net} +URI=https://bf-static-main.bxdev.net TOME_PROCESS_COUNT=${TOME_PROCESS_COUNT:-1} From f64528bc13c0a506d48c76011ca372979af6778c Mon Sep 17 00:00:00 2001 From: Xavier Metichecchia Date: Mon, 21 Oct 2024 16:05:45 -0400 Subject: [PATCH 03/10] PXBF-main: Reset tome scripts to main URI without 1 2 --- scripts/application/bf-tome-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/application/bf-tome-run.sh b/scripts/application/bf-tome-run.sh index ab42134d..209a555b 100755 --- a/scripts/application/bf-tome-run.sh +++ b/scripts/application/bf-tome-run.sh @@ -4,7 +4,7 @@ SCRIPT_PATH=$(dirname "$0") SCRIPT_NAME=$(basename "$0") SCRIPT_PID=$$ -URI=${1:-https://bf-static-main.bxdev.net} +# URI=${1:-https://bf-static-main.bxdev.net} URI=https://bf-static-main.bxdev.net # URI=https://bf-static-dev.bxdev.net FORCE=${2:-0} From 2f8b8005237fb8e1bd2f5eef6914cf8d84beb8e2 Mon Sep 17 00:00:00 2001 From: Xavier Metichecchia Date: Tue, 22 Oct 2024 13:49:05 -0400 Subject: [PATCH 04/10] PXBF-main: Restore old code for variables, set echos to check them in logs --- scripts/application/bf-tome-run.sh | 26 +++++++++--------- scripts/application/static-generation.sh | 34 +++++++----------------- 2 files changed, 22 insertions(+), 38 deletions(-) diff --git a/scripts/application/bf-tome-run.sh b/scripts/application/bf-tome-run.sh index 209a555b..a211ff1b 100755 --- a/scripts/application/bf-tome-run.sh +++ b/scripts/application/bf-tome-run.sh @@ -15,19 +15,19 @@ YMDHMS=$(date +"%Y_%m_%d_%H_%M_%S") TR_START_TIME=$(date -u +"%s") -export BUCKET_NAME=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.bucket') -export AWS_DEFAULT_REGION=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.region') -export AWS_ACCESS_KEY_ID=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.access_key_id') -export AWS_ENDPOINT=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.endpoint') - -# export BUCKET_NAME=$(echo "$VCAP_SERVICES" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.bucket') -# export AWS_DEFAULT_REGION=$(echo "$VCAP_SERVICES" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.region') -# export AWS_ACCESS_KEY_ID=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.access_key_id') -# export AWS_SECRET_ACCESS_KEY=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.secret_access_key') -# export AWS_ENDPOINT=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.hostname') -# if [ -z "$AWS_ENDPOINT" ] || [ "$AWS_ENDPOINT" == "null" ]; then -# export AWS_ENDPOINT=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.endpoint'); -# fi +# export BUCKET_NAME=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.bucket') +# export AWS_DEFAULT_REGION=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.region') +# export AWS_ACCESS_KEY_ID=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.access_key_id') +# export AWS_ENDPOINT=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.endpoint') + +export BUCKET_NAME=$(echo "$VCAP_SERVICES" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.bucket') +export AWS_DEFAULT_REGION=$(echo "$VCAP_SERVICES" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.region') +export AWS_ACCESS_KEY_ID=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.access_key_id') +export AWS_SECRET_ACCESS_KEY=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.secret_access_key') +export AWS_ENDPOINT=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.hostname') +if [ -z "$AWS_ENDPOINT" ] || [ "$AWS_ENDPOINT" == "null" ]; then + export AWS_ENDPOINT=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.endpoint'); +fi S3_EXTRA_PARAMS="" if [ "${APP_SPACE}" = "local" ]; then diff --git a/scripts/application/static-generation.sh b/scripts/application/static-generation.sh index b749cd06..f5f8b29c 100755 --- a/scripts/application/static-generation.sh +++ b/scripts/application/static-generation.sh @@ -12,26 +12,35 @@ mkdir -p "${html_path}" export PYTHONWARNINGS="ignore:Unverified HTTPS request" +echo "VCAP_APPLICATION: ${VCAP_APPLICATION}" application_uri=$(echo "${VCAP_APPLICATION}" | jq -r '.application_uris[]') export application_uri +echo "application_uri: ${application_uri}" +echo "VCAP_SERVICES: ${VCAP_SERVICES}" AWS_ACCESS_KEY_ID=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.access_key_id') export AWS_ACCESS_KEY_ID +echo "AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}" AWS_SECRET_ACCESS_KEY=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.secret_access_key') export AWS_SECRET_ACCESS_KEY +echo "AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}" AWS_DEFAULT_REGION=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.region') export AWS_DEFAULT_REGION +echo "AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}" bucket_name=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).name') export bucket_name +echo "bucket_name: ${bucket_name}" bucket=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.bucket') export bucket +echo "bucket: ${bucket}" bucket_endpoint=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.endpoint') export bucket_endpoint +echo "bucket_endpoint: ${bucket_endpoint}" # export ssg_endpoint="http://benefit-finder-cms-dev.app.cloud.gov" # [ "${environment}" = "prod" ] && export ssg_endpoint="https://ssg.vote.gov" @@ -49,24 +58,6 @@ echo "Running 'drush tome:static' in '${environment}'..." # /var/www/vendor/bin/drush tome:static-export-path '/sitemap.xml,/sitemap_generator/default/sitemap.xsl' --uri=${ssg_endpoint} --process-count=2 --retry-count=0 -y echo "'drush tome:static' task completed!" -# echo "Adding missing Core assets vendor directory" -# mkdir -p ${html_path}/core/assets -# cp -rfp ${app_path}/web/core/assets/vendor ${html_path}/core/assets/ -# echo "Missing Core assets files completed!" - -# echo "Adding missing module files for Sitemap" -# mkdir -p ${html_path}/modules/contrib/simple_sitemap/xsl -# cp -rfp ${app_path}/web/modules/contrib/simple_sitemap/xsl/* ${html_path}/modules/contrib/simple_sitemap/xsl/ -# echo "Missing module files for Sitemap completed!" - -# echo "Adding Vote.gov custom theme assets" -# mkdir -p ${html_path}/themes/custom/votegov -# cp -rfp ${app_path}/web/themes/custom/votegov/dist ${html_path}/themes/custom/votegov/ -# cp -rfp ${app_path}/web/themes/custom/votegov/fonts ${html_path}/themes/custom/votegov/ -# cp -rfp ${app_path}/web/themes/custom/votegov/img ${html_path}/themes/custom/votegov/ -# cp -rfp ${app_path}/web/themes/custom/votegov/json ${html_path}/themes/custom/votegov/ -# echo "Adding Vote.gov custom theme assets - completed!" - cd "${html_path}" || exit 1 echo "Copying static files to '${bucket_name}'..." cp -r /var/www/web/themes/custom/usagov/fonts ${html_path}/themes/custom/usagov @@ -75,10 +66,3 @@ cp -r /var/www/web/themes/custom/usagov/assets ${html_path}/themes/custom/usagov aws s3 sync . "s3://${bucket}" --delete --no-verify-ssl # 2>/dev/null aws s3 website "s3://${bucket}" --index-document index.html --error-document /404/index.html --no-verify-ssl # 2>/dev/null echo "Copy to '${bucket_name}' completed!" - -# export objects=($(aws s3 ls s3://${bucket} --recursive --no-verify-ssl 2>/dev/null | awk '{print $(NF)}' | sed -z -e 's/\n/ /g')) - -# for object in "${objects[@]}"; do -# echo $object -# aws s3api put-object-acl --bucket s3://${bucket} --key $object --grant-full-control id=c0eaf99010b9e4b073052b3a9b242980a2badf4e1db4044f53f49950609bf6cf --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers --no-verify-ssl # 2>/dev/null -# done \ No newline at end of file From b9c38e8a674636cd9e47337a91380b3597fcd716 Mon Sep 17 00:00:00 2001 From: Xavier Metichecchia Date: Thu, 24 Oct 2024 10:09:55 -0400 Subject: [PATCH 05/10] PXBF-main: Show variables in logs --- scripts/application/bf-tome-run.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/application/bf-tome-run.sh b/scripts/application/bf-tome-run.sh index a211ff1b..dee22900 100755 --- a/scripts/application/bf-tome-run.sh +++ b/scripts/application/bf-tome-run.sh @@ -29,11 +29,21 @@ if [ -z "$AWS_ENDPOINT" ] || [ "$AWS_ENDPOINT" == "null" ]; then export AWS_ENDPOINT=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.endpoint'); fi + +echo "BUCKET_NAME: $BUCKET_NAME" +echo "AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION" +echo "AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID" +echo "AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY" +echo "AWS_ENDPOINT: $AWS_ENDPOINT" + + S3_EXTRA_PARAMS="" if [ "${APP_SPACE}" = "local" ]; then S3_EXTRA_PARAMS="--endpoint-url https://$AWS_ENDPOINT --no-verify-ssl" fi +echo "AWS_ENDPOINT 2: $AWS_ENDPOINT" + # grab the cloudgov space we are hosted in APP_SPACE=$(echo "$VCAP_APPLICATION" | jq -r '.space_name') APP_SPACE=${APP_SPACE:-local} From 67ee5552f72b3eabbddd15beac52adf680bf0019 Mon Sep 17 00:00:00 2001 From: Xavier Metichecchia Date: Thu, 24 Oct 2024 13:46:54 -0400 Subject: [PATCH 06/10] PXBF-main: Add dbstorage line to manifest.yml file even if placeholder not found --- .github/workflows/build-and-deploy.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 1c851f90..99301fff 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -201,7 +201,10 @@ jobs: sed -i "s#^ memory: 1.5G# memory: ${MEMORY}#" manifest.yml sed -i "s#^ - database# - ${PROJECT}-mysql-${BRANCH}#" manifest.yml sed -i "s#^ - secrets# - ${PROJECT}-secrets-${BRANCH}#" manifest.yml - sed -i "s#^ - storage# - ${PROJECT}-storage-${BRANCH}#" manifest.yml + # sed -i "s#^ - storage# - ${PROJECT}-storage-${BRANCH}#" manifest.yml + sed -i "/^ - storage/{s#^ - storage# - ${PROJECT}-storage-${BRANCH}#;a\\ + - ${PROJECT}-static-${BRANCH} + }" manifest.yml sed -i "s#^ - dbstorage# - ${PROJECT}-static-${BRANCH}#" manifest.yml sed -i '16i\ command: /var/www/scripts/entrypoint.sh' manifest.yml - name: Deploy application From 939feacf04e259506c3b2b4937b664d4f7c00926 Mon Sep 17 00:00:00 2001 From: Xavier Metichecchia Date: Thu, 24 Oct 2024 14:14:35 -0400 Subject: [PATCH 07/10] PXBF-main: Add dbstorage line to manifest.yml file even if placeholder not found 2 --- .github/workflows/build-and-deploy.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 99301fff..769d8ff8 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -202,9 +202,7 @@ jobs: sed -i "s#^ - database# - ${PROJECT}-mysql-${BRANCH}#" manifest.yml sed -i "s#^ - secrets# - ${PROJECT}-secrets-${BRANCH}#" manifest.yml # sed -i "s#^ - storage# - ${PROJECT}-storage-${BRANCH}#" manifest.yml - sed -i "/^ - storage/{s#^ - storage# - ${PROJECT}-storage-${BRANCH}#;a\\ - - ${PROJECT}-static-${BRANCH} - }" manifest.yml + sed -i "/^ - storage/{s#^ - storage# - ${PROJECT}-storage-${BRANCH}#;a\\ - ${PROJECT}-static-${BRANCH}}" manifest.yml sed -i "s#^ - dbstorage# - ${PROJECT}-static-${BRANCH}#" manifest.yml sed -i '16i\ command: /var/www/scripts/entrypoint.sh' manifest.yml - name: Deploy application From daff16d90a44db173ab73e7f63aba9ed228f5a75 Mon Sep 17 00:00:00 2001 From: Xavier Metichecchia Date: Thu, 24 Oct 2024 14:36:48 -0400 Subject: [PATCH 08/10] PXBF-main: Add dbstorage line to manifest.yml file even if placeholder not found 3 --- .github/workflows/build-and-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 769d8ff8..3e3320aa 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -202,7 +202,7 @@ jobs: sed -i "s#^ - database# - ${PROJECT}-mysql-${BRANCH}#" manifest.yml sed -i "s#^ - secrets# - ${PROJECT}-secrets-${BRANCH}#" manifest.yml # sed -i "s#^ - storage# - ${PROJECT}-storage-${BRANCH}#" manifest.yml - sed -i "/^ - storage/{s#^ - storage# - ${PROJECT}-storage-${BRANCH}#;a\\ - ${PROJECT}-static-${BRANCH}}" manifest.yml + sed -i "/^ - storage/s#^ - storage# - ${PROJECT}-storage-${BRANCH}#/; /^ - ${PROJECT}-storage-${BRANCH}/a\\ - ${PROJECT}-static-${BRANCH}" manifest.yml sed -i "s#^ - dbstorage# - ${PROJECT}-static-${BRANCH}#" manifest.yml sed -i '16i\ command: /var/www/scripts/entrypoint.sh' manifest.yml - name: Deploy application From 42a42354282ffaedf46e7e05ef0d0406b7d845bd Mon Sep 17 00:00:00 2001 From: Xavier Metichecchia Date: Thu, 24 Oct 2024 15:21:07 -0400 Subject: [PATCH 09/10] PXBF-main: Add dbstorage line to manifest.yml file even if placeholder not found 4 --- .github/workflows/build-and-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 3e3320aa..6aaa425b 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -201,8 +201,8 @@ jobs: sed -i "s#^ memory: 1.5G# memory: ${MEMORY}#" manifest.yml sed -i "s#^ - database# - ${PROJECT}-mysql-${BRANCH}#" manifest.yml sed -i "s#^ - secrets# - ${PROJECT}-secrets-${BRANCH}#" manifest.yml - # sed -i "s#^ - storage# - ${PROJECT}-storage-${BRANCH}#" manifest.yml - sed -i "/^ - storage/s#^ - storage# - ${PROJECT}-storage-${BRANCH}#/; /^ - ${PROJECT}-storage-${BRANCH}/a\\ - ${PROJECT}-static-${BRANCH}" manifest.yml + sed -i "s#^ - storage# - ${PROJECT}-storage-${BRANCH}#" manifest.yml + sed -i "/${PROJECT}-storage-${BRANCH}/a\ - ${PROJECT}-static-${BRANCH}" manifest.yml sed -i "s#^ - dbstorage# - ${PROJECT}-static-${BRANCH}#" manifest.yml sed -i '16i\ command: /var/www/scripts/entrypoint.sh' manifest.yml - name: Deploy application From fae6bf3f5ce4b7294b6dc5d098015140f5f30ee6 Mon Sep 17 00:00:00 2001 From: Xavier Metichecchia Date: Mon, 28 Oct 2024 10:47:33 -0400 Subject: [PATCH 10/10] PXBF-main: Undo my tome testing changes in main 1 --- .github/workflows/build-and-deploy.yml | 3 +-- scripts/application/bf-tome-run.sh | 17 +---------------- scripts/application/bf-tome-static.sh | 4 +--- scripts/application/static-generation.sh | 9 --------- 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 6aaa425b..0416069f 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -158,7 +158,7 @@ jobs: sed -i 's/80/8080/g' Dockerfile-cms sed -i 's/ENTRYPOINT/CMD/' Dockerfile-cms sed -i 's/\["s3"\]\[\]?/s3\[\]/g' scripts/tome-run.sh scripts/tome-sync.sh - # sed -i "s|/var/www/scripts/tome-run.sh \$URI \$@||" .docker/src-cms/etc/periodic/1min/generate-static-site + sed -i "s|/var/www/scripts/tome-run.sh \$URI \$@||" .docker/src-cms/etc/periodic/1min/generate-static-site sed -i 's/80/8080/g' .docker/src-cms/etc/nginx/partials/cms.conf.tmpl sed -i '/listen 8080 default_server;/a\ port_in_redirect off;' .docker/src-cms/etc/nginx/partials/cms.conf.tmpl sed -i "s/\$service\['name'\] === 'database'/stristr(\$service\['name'\], 'mysql')/" web/sites/default/settings.php @@ -202,7 +202,6 @@ jobs: sed -i "s#^ - database# - ${PROJECT}-mysql-${BRANCH}#" manifest.yml sed -i "s#^ - secrets# - ${PROJECT}-secrets-${BRANCH}#" manifest.yml sed -i "s#^ - storage# - ${PROJECT}-storage-${BRANCH}#" manifest.yml - sed -i "/${PROJECT}-storage-${BRANCH}/a\ - ${PROJECT}-static-${BRANCH}" manifest.yml sed -i "s#^ - dbstorage# - ${PROJECT}-static-${BRANCH}#" manifest.yml sed -i '16i\ command: /var/www/scripts/entrypoint.sh' manifest.yml - name: Deploy application diff --git a/scripts/application/bf-tome-run.sh b/scripts/application/bf-tome-run.sh index dee22900..a6065346 100755 --- a/scripts/application/bf-tome-run.sh +++ b/scripts/application/bf-tome-run.sh @@ -4,9 +4,7 @@ SCRIPT_PATH=$(dirname "$0") SCRIPT_NAME=$(basename "$0") SCRIPT_PID=$$ -# URI=${1:-https://bf-static-main.bxdev.net} -URI=https://bf-static-main.bxdev.net -# URI=https://bf-static-dev.bxdev.net +URI=${1:-https://bf-static-main.bxdev.net} FORCE=${2:-0} RETRY_SEMAPHORE_FILE=/tmp/tome-log/retry-on-next-run @@ -15,11 +13,6 @@ YMDHMS=$(date +"%Y_%m_%d_%H_%M_%S") TR_START_TIME=$(date -u +"%s") -# export BUCKET_NAME=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.bucket') -# export AWS_DEFAULT_REGION=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.region') -# export AWS_ACCESS_KEY_ID=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.access_key_id') -# export AWS_ENDPOINT=$(echo "$VCAP_SERVICES" | jq -r '.s3[0].credentials.endpoint') - export BUCKET_NAME=$(echo "$VCAP_SERVICES" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.bucket') export AWS_DEFAULT_REGION=$(echo "$VCAP_SERVICES" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.region') export AWS_ACCESS_KEY_ID=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.access_key_id') @@ -30,20 +23,12 @@ if [ -z "$AWS_ENDPOINT" ] || [ "$AWS_ENDPOINT" == "null" ]; then fi -echo "BUCKET_NAME: $BUCKET_NAME" -echo "AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION" -echo "AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID" -echo "AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY" -echo "AWS_ENDPOINT: $AWS_ENDPOINT" - S3_EXTRA_PARAMS="" if [ "${APP_SPACE}" = "local" ]; then S3_EXTRA_PARAMS="--endpoint-url https://$AWS_ENDPOINT --no-verify-ssl" fi -echo "AWS_ENDPOINT 2: $AWS_ENDPOINT" - # grab the cloudgov space we are hosted in APP_SPACE=$(echo "$VCAP_APPLICATION" | jq -r '.space_name') APP_SPACE=${APP_SPACE:-local} diff --git a/scripts/application/bf-tome-static.sh b/scripts/application/bf-tome-static.sh index 678cf2ca..825a605c 100755 --- a/scripts/application/bf-tome-static.sh +++ b/scripts/application/bf-tome-static.sh @@ -1,9 +1,7 @@ #!/bin/sh set -x -# URI=https://bf-static-dev.bxdev.net -# URI=${1:-https://bf-static-main.bxdev.net} -URI=https://bf-static-main.bxdev.net +URI=${1:-https://bf-static-main.bxdev.net} TOME_PROCESS_COUNT=${TOME_PROCESS_COUNT:-1} diff --git a/scripts/application/static-generation.sh b/scripts/application/static-generation.sh index f5f8b29c..21c63ae3 100755 --- a/scripts/application/static-generation.sh +++ b/scripts/application/static-generation.sh @@ -12,35 +12,26 @@ mkdir -p "${html_path}" export PYTHONWARNINGS="ignore:Unverified HTTPS request" -echo "VCAP_APPLICATION: ${VCAP_APPLICATION}" application_uri=$(echo "${VCAP_APPLICATION}" | jq -r '.application_uris[]') export application_uri -echo "application_uri: ${application_uri}" -echo "VCAP_SERVICES: ${VCAP_SERVICES}" AWS_ACCESS_KEY_ID=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.access_key_id') export AWS_ACCESS_KEY_ID -echo "AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}" AWS_SECRET_ACCESS_KEY=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.secret_access_key') export AWS_SECRET_ACCESS_KEY -echo "AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}" AWS_DEFAULT_REGION=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.region') export AWS_DEFAULT_REGION -echo "AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}" bucket_name=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).name') export bucket_name -echo "bucket_name: ${bucket_name}" bucket=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.bucket') export bucket -echo "bucket: ${bucket}" bucket_endpoint=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(.name | strings | test("static")).credentials.endpoint') export bucket_endpoint -echo "bucket_endpoint: ${bucket_endpoint}" # export ssg_endpoint="http://benefit-finder-cms-dev.app.cloud.gov" # [ "${environment}" = "prod" ] && export ssg_endpoint="https://ssg.vote.gov"