From b1fc50a64b3402c4cf3bcfecfbb1949c1d4aafe3 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Sun, 16 Aug 2020 10:41:31 +0200 Subject: [PATCH 1/4] Using env variable to detect Netlify deployment --- build-site.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build-site.sh b/build-site.sh index ec799cadfa7b..6ac9b375ccd1 100755 --- a/build-site.sh +++ b/build-site.sh @@ -1,13 +1,22 @@ #!/bin/bash +if [[ -z "${DEPLOY_PRIME_URL}" ]]; then + USE_BASE_URL_SITE="" + USE_BASE_URL_SITE_DOCS="" +else + echo -e "\033[0;32mNetlify DEPLOY_PRIME_URL detected, this seems to be a PR, deployment happening at ${DEPLOY_PRIME_URL}...\033[0m" + USE_BASE_URL_SITE="-b ${DEPLOY_PRIME_URL}" + USE_BASE_URL_SITE_DOCS="-b ${DEPLOY_PRIME_URL}/documentation" +fi + echo -e "\033[0;32mDeleting Hugo previously generated directories for docs and main site...\033[0m" rm -rf site_source_files/public && rm -rf docs_source_files/public echo -e "\033[0;32mGenerating Hugo site for docs...\033[0m" -cd docs_source_files && hugo && cd .. +cd docs_source_files && hugo --minify && cd .. echo -e "\033[0;32mGenerating Hugo site for main website...\033[0m" -cd site_source_files && hugo && cd .. +cd site_source_files && hugo --minify && cd .. echo -e "\033[0;32mMerging both sites into a single one...\033[0m" mv docs_source_files/public/* site_source_files/public/documentation From e2eaa57932f643d4fb77ccd1f99e7367897cf184 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Sun, 16 Aug 2020 10:45:09 +0200 Subject: [PATCH 2/4] Update build-site.sh --- build-site.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build-site.sh b/build-site.sh index 6ac9b375ccd1..7b4a8460b184 100755 --- a/build-site.sh +++ b/build-site.sh @@ -6,17 +6,17 @@ if [[ -z "${DEPLOY_PRIME_URL}" ]]; then else echo -e "\033[0;32mNetlify DEPLOY_PRIME_URL detected, this seems to be a PR, deployment happening at ${DEPLOY_PRIME_URL}...\033[0m" USE_BASE_URL_SITE="-b ${DEPLOY_PRIME_URL}" - USE_BASE_URL_SITE_DOCS="-b ${DEPLOY_PRIME_URL}/documentation" + USE_BASE_URL_DOCS="-b ${DEPLOY_PRIME_URL}/documentation" fi echo -e "\033[0;32mDeleting Hugo previously generated directories for docs and main site...\033[0m" rm -rf site_source_files/public && rm -rf docs_source_files/public echo -e "\033[0;32mGenerating Hugo site for docs...\033[0m" -cd docs_source_files && hugo --minify && cd .. +cd docs_source_files && hugo --minify ${URL_BASE_DOCS} && cd .. echo -e "\033[0;32mGenerating Hugo site for main website...\033[0m" -cd site_source_files && hugo --minify && cd .. +cd site_source_files && hugo --minify ${URL_BASE_SITE} && cd .. echo -e "\033[0;32mMerging both sites into a single one...\033[0m" mv docs_source_files/public/* site_source_files/public/documentation From 7cecc82176c15b097b45ce8a075ff84edd9ca7c0 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Sun, 16 Aug 2020 10:47:54 +0200 Subject: [PATCH 3/4] Create netlify.toml --- netlify.toml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 netlify.toml diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 000000000000..ec9c13e2f173 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,19 @@ +[build] +publish = "site_source_files/public" +command = "chmod +x build-site.sh && ./build-site.sh" + +[context.production.environment] +HUGO_VERSION = "0.66.0" +HUGO_ENV = "production" + +[context.deploy-preview] +command = "chmod +x build-site.sh && ./build-site.sh" + +[context.deploy-preview.environment] +HUGO_VERSION = "0.66.0" + +[context.branch-deploy] +command = "chmod +x build-site.sh && ./build-site.sh" + +[context.branch-deploy.environment] +HUGO_VERSION = "0.66.0" From e2ae7f734872b482a34e498a67ecbfdd51e480e4 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Sun, 16 Aug 2020 10:57:46 +0200 Subject: [PATCH 4/4] Renaming to enable Netlify deployments --- site_source_files/content/downloads/{C#.md => c_sharp.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename site_source_files/content/downloads/{C#.md => c_sharp.md} (99%) diff --git a/site_source_files/content/downloads/C#.md b/site_source_files/content/downloads/c_sharp.md similarity index 99% rename from site_source_files/content/downloads/C#.md rename to site_source_files/content/downloads/c_sharp.md index 230d9fd43a4b..5115f7a8cc02 100755 --- a/site_source_files/content/downloads/C#.md +++ b/site_source_files/content/downloads/c_sharp.md @@ -10,4 +10,4 @@ DownloadLink = "https://goo.gl/uJJ5Sc" AlphaDownloadLink = "https://www.nuget.org/api/v2/package/Selenium.WebDriver/4.0.0-alpha05" ChangelogLink = "https://raw.githubusercontent.com/SeleniumHQ/selenium/trunk/dotnet/CHANGELOG" DocsLink = "https://goo.gl/uutZjZ" -+++ \ No newline at end of file ++++