Skip to content

Commit

Permalink
PXBF-main: Undo my tome testing changes in main 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Metichecchia authored and Xavier Metichecchia committed Oct 28, 2024
1 parent 42a4235 commit fae6bf3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 30 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
17 changes: 1 addition & 16 deletions scripts/application/bf-tome-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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')
Expand All @@ -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}
Expand Down
4 changes: 1 addition & 3 deletions scripts/application/bf-tome-static.sh
Original file line number Diff line number Diff line change
@@ -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}

Expand Down
9 changes: 0 additions & 9 deletions scripts/application/static-generation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit fae6bf3

Please sign in to comment.