diff --git a/scripts/application/bf-tome-run.sh b/scripts/application/bf-tome-run.sh index e8d2a5f5..72c790a7 100755 --- a/scripts/application/bf-tome-run.sh +++ b/scripts/application/bf-tome-run.sh @@ -12,6 +12,7 @@ YMD=$(date +"%Y/%m/%d") YMDHMS=$(date +"%Y_%m_%d_%H_%M_%S") TR_START_TIME=$(date -u +"%s") + 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') @@ -19,7 +20,8 @@ export AWS_SECRET_ACCESS_KEY=$(echo "${VCAP_SERVICES}" | jq -r '.s3[] | select(. 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 + +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..21c63ae3 100755 --- a/scripts/application/static-generation.sh +++ b/scripts/application/static-generation.sh @@ -49,24 +49,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 +57,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