From b056cf642c20432a31c8534b0fa8d1d246d47abd Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 10:53:00 -0500 Subject: [PATCH 01/14] nested example --- gatsby-config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/gatsby-config.js b/gatsby-config.js index be75b39..f845063 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,6 +1,7 @@ const btoa = require("btoa") module.exports = { + pathPrefix: `/nested-example/site`, siteMetadata: { title: `Steve Persch's Blog`, description: `It's mostly just blog posts about Drupal`, From 1688f8b1ae1f7ed1a859d864322596f530221ca2 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 10:57:58 -0500 Subject: [PATCH 02/14] Update config.yml --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1159510..8b77e2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,8 @@ workflows: - pfe/gatsby-build-and-deploy: # trying to get the build to break with example.com data-source-url: "live-stevector-drupal.pantheonsite.io" + deployment-path: "nested-example/site" + deployment-path: docs resource-class: "small" pre-steps: - pfe/set-terminus-env From 84a0798d3a25ca711eabadc1da92d9e210d62476 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 10:58:13 -0500 Subject: [PATCH 03/14] Update config.yml --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b77e2c..92a88cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,7 +15,6 @@ workflows: # trying to get the build to break with example.com data-source-url: "live-stevector-drupal.pantheonsite.io" deployment-path: "nested-example/site" - deployment-path: docs resource-class: "small" pre-steps: - pfe/set-terminus-env From 59b145b3296c7e9de7989bde27c69dc9626d23bb Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 11:01:01 -0500 Subject: [PATCH 04/14] Update gatsby-config.js --- gatsby-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index f845063..0ecb9a0 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -66,7 +66,7 @@ module.exports = { options: { name: `gatsby-starter-default`, short_name: `starter`, - start_url: `/`, + start_url: `/nested-example/site`, background_color: `#663399`, theme_color: `#663399`, display: `minimal-ui`, From 16fcc6876951a6b761cdcf8d110a444fbc04aca9 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 11:17:08 -0500 Subject: [PATCH 05/14] cp 404.html --- .circleci/config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 92a88cf..ba89926 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,6 +20,16 @@ workflows: - pfe/set-terminus-env post-steps: + + + - run: + name: Sync to GCP Bucket + command: | + gsutil cp ./public/404.html gs://<>/${TERMINUS_SITE}/${TERMINUS_ENV}/ + gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://<>/${TERMINUS_SITE}/${TERMINUS_ENV}/404.html + + + - run: name: post deployment completion status command: | From 6c8d5b6a0a8ec9fb58c0972c17a56e27246b81d7 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 11:23:43 -0500 Subject: [PATCH 06/14] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ba89926..6df3aac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,8 +25,8 @@ workflows: - run: name: Sync to GCP Bucket command: | - gsutil cp ./public/404.html gs://<>/${TERMINUS_SITE}/${TERMINUS_ENV}/ - gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://<>/${TERMINUS_SITE}/${TERMINUS_ENV}/404.html + gsutil cp ./public/404.html gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/ + gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/404.html From c67b3ae43ea96324f4eeea6e15c8bcd650af00b7 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 14:09:42 -0500 Subject: [PATCH 07/14] if statement --- .circleci/config.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6df3aac..787c24b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,12 +23,17 @@ workflows: - run: - name: Sync to GCP Bucket + name: 404 and redirects command: | - gsutil cp ./public/404.html gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/ - gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/404.html - - + if [[ -f ./public/404.html ]] then; + gsutil cp ./public/404.html gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/ + gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/404.html + fi + + if [[ -f ./public/redirects.json ]] then; + gsutil cp ./public/redirects.json gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/ + gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/redirect.json + fi - run: name: post deployment completion status From dc8c75388345217099b208d46a29ae18e5eed247 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 14:10:11 -0500 Subject: [PATCH 08/14] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 787c24b..73090af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,7 @@ workflows: if [[ -f ./public/redirects.json ]] then; gsutil cp ./public/redirects.json gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/ - gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/redirect.json + gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/redirects.json fi - run: From 1346580603b0122b3063ce7ab2823539b5c3b9ac Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 14:12:34 -0500 Subject: [PATCH 09/14] Update config.yml --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 73090af..289bc01 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,8 +20,6 @@ workflows: - pfe/set-terminus-env post-steps: - - - run: name: 404 and redirects command: | From fb5dbff6e0d6437478bf5ffe7f0ae66dd8ba98e1 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 14:45:35 -0500 Subject: [PATCH 10/14] Update config.yml --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 289bc01..6dd98fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,12 +23,12 @@ workflows: - run: name: 404 and redirects command: | - if [[ -f ./public/404.html ]] then; + if [[ -f ./public/404.html ]]; then gsutil cp ./public/404.html gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/ gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/404.html fi - if [[ -f ./public/redirects.json ]] then; + if [[ -f ./public/redirects.json ]]; then gsutil cp ./public/redirects.json gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/ gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/redirects.json fi From 331e48b586788e830c774654d13c95b1cfebdba6 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 14:47:55 -0500 Subject: [PATCH 11/14] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6dd98fe..f1bfde0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,7 +43,7 @@ workflows: include_job_number_field: false include_visit_job_action: false title: "Pull Request $TERMINUS_ENV has been deployed" - title_link: "https://${TERMINUS_ENV}--${TERMINUS_SITE}.my.pantheonfrontend.website/" + title_link: "https://${TERMINUS_ENV}--${TERMINUS_SITE}.my.pantheonfrontend.website/nested-example/site"" #channel: CHANNELID #color: '#42e2f4' #mentions: 'USERID1,USERID2,' From 62d12b3a247f5f15f04ac67ef87337b9695297f6 Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 14:51:35 -0500 Subject: [PATCH 12/14] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f1bfde0..a39b62c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,7 +43,7 @@ workflows: include_job_number_field: false include_visit_job_action: false title: "Pull Request $TERMINUS_ENV has been deployed" - title_link: "https://${TERMINUS_ENV}--${TERMINUS_SITE}.my.pantheonfrontend.website/nested-example/site"" + title_link: "https://${TERMINUS_ENV}--${TERMINUS_SITE}.my.pantheonfrontend.website/nested-example/site" #channel: CHANNELID #color: '#42e2f4' #mentions: 'USERID1,USERID2,' From e0b4c8bd80092cc60522b8fe03e126e1466e0e2f Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Fri, 12 Jun 2020 14:56:20 -0500 Subject: [PATCH 13/14] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a39b62c..78ba2ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ workflows: - run: name: post deployment completion status command: | - curl "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/statuses/$CIRCLE_SHA1" -H "Authorization: token $GITHUB_TOKEN" -X POST -d '{"state": "success", "context": "pantheon/deployment", "description": "Deployment complete", "target_url": "https://'${TERMINUS_ENV}'--'${TERMINUS_SITE}'.my.pantheonfrontend.website/"}' + curl "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/statuses/$CIRCLE_SHA1" -H "Authorization: token $GITHUB_TOKEN" -X POST -d '{"state": "success", "context": "pantheon/deployment", "description": "Deployment complete", "target_url": "https://'${TERMINUS_ENV}'--'${TERMINUS_SITE}'.my.pantheonfrontend.website/nested-example/site"}' - slack/notify: # image_url: "https://pantheon.io/sites/all/themes/zeus/images/pantheon-OG-backup.png" From 4706486629a9d304d386954083016426c2cd2d8f Mon Sep 17 00:00:00 2001 From: Steve Persch Date: Thu, 18 Jun 2020 11:33:49 -0500 Subject: [PATCH 14/14] Update config.yml --- .circleci/config.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 78ba2ce..e4a71cd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,20 +19,6 @@ workflows: pre-steps: - pfe/set-terminus-env - post-steps: - - run: - name: 404 and redirects - command: | - if [[ -f ./public/404.html ]]; then - gsutil cp ./public/404.html gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/ - gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/404.html - fi - - if [[ -f ./public/redirects.json ]]; then - gsutil cp ./public/redirects.json gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/ - gsutil setmeta -h "Cache-Control:public, s-maxage=10, stale-while-revalidate=600" gs://static.pantheonfrontend.website/${TERMINUS_SITE}/${TERMINUS_ENV}/redirects.json - fi - - run: name: post deployment completion status command: | @@ -50,6 +36,6 @@ workflows: message: "Preview your changes on Pantheon" orbs: - pfe: pantheon-systems/front-end@dev:selective-caching + pfe: pantheon-systems/front-end@dev:conditional-redirects-fix slack: circleci/slack@3.4.2 # pfe: stevector/pantheon-frontend@dev:orb-params