Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierMetichecchia authored Oct 30, 2024
2 parents 8b0d5f8 + fae6bf3 commit 41147b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
4 changes: 3 additions & 1 deletion scripts/application/bf-tome-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ 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')
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

fi

S3_EXTRA_PARAMS=""
if [ "${APP_SPACE}" = "local" ]; then
Expand Down
25 changes: 0 additions & 25 deletions scripts/application/static-generation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 41147b4

Please sign in to comment.