From 9dd9c828761d37320a43afe064c64a602ee8ee03 Mon Sep 17 00:00:00 2001 From: Ivy Gooch Date: Tue, 17 Jan 2023 17:46:38 +0000 Subject: [PATCH] Adds snapshot Hugo env to separate from default production env Updates shortcodes to use supported K8s version for snapshot environment --- build/includes/release.mk | 4 ++-- build/includes/website.mk | 2 +- site/layouts/shortcodes/aks-k8s-minor-version.html | 4 ++-- site/layouts/shortcodes/k8s-api.html | 9 +++++++-- site/layouts/shortcodes/k8s-version.html | 4 ++-- site/layouts/shortcodes/minikube-k8s-minor-version.html | 4 ++-- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/build/includes/release.mk b/build/includes/release.mk index 839204464a..1d9c6b79f5 100644 --- a/build/includes/release.mk +++ b/build/includes/release.mk @@ -63,7 +63,7 @@ release-deploy-site: DOCKER_RUN_ARGS += -e GOFLAGS="-mod=mod" --entrypoint=/usr/ release-deploy-site: version=$$($(DOCKER_RUN) run $(mount_path)/build/scripts/previousversion/main.go -version $(base_version)) && \ echo "Deploying Site Version: $$version" && \ - $(MAKE) site-deploy SERVICE=$$version + $(MAKE) ENV=HUGO_ENV=snapshot site-deploy SERVICE=$$version # Creates a release. Version defaults to the base_version # - Checks out a release branch @@ -100,6 +100,6 @@ build-release: RELEASE_VERSION=$(base_version)-rc else build-release: RELEASE_VERSION=$(base_version) endif -build-release: +build-release: cd $(agones_path) && gcloud builds submit . --substitutions _VERSION=$(RELEASE_VERSION) --config=./build/release/cloudbuild.yaml $(ARGS) diff --git a/build/includes/website.mk b/build/includes/website.mk index f50e4771a0..70fd5f7b09 100644 --- a/build/includes/website.mk +++ b/build/includes/website.mk @@ -107,4 +107,4 @@ test-gen-api-docs: ensure-build-image sort /tmp/generated.html > /tmp/generated.html.sorted $(GEN_API_DOCS) sort $(expected_docs) > /tmp/result.sorted - diff -bB /tmp/result.sorted /tmp/generated.html.sorted \ No newline at end of file + diff -bB /tmp/result.sorted /tmp/generated.html.sorted diff --git a/site/layouts/shortcodes/aks-k8s-minor-version.html b/site/layouts/shortcodes/aks-k8s-minor-version.html index 7b27116fce..becb21ba4d 100644 --- a/site/layouts/shortcodes/aks-k8s-minor-version.html +++ b/site/layouts/shortcodes/aks-k8s-minor-version.html @@ -1,5 +1,5 @@ -{{- if eq (getenv "HUGO_ENV") "production" }} +{{- if or (eq (getenv "HUGO_ENV") "production") (eq (getenv "HUGO_ENV") "snapshot")}} {{- $.Page.Site.Params.aks_minor_supported_k8s }} {{- else }} {{- $.Page.Site.Params.dev_aks_minor_supported_k8s }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/site/layouts/shortcodes/k8s-api.html b/site/layouts/shortcodes/k8s-api.html index cb39feab42..decd04bcf2 100644 --- a/site/layouts/shortcodes/k8s-api.html +++ b/site/layouts/shortcodes/k8s-api.html @@ -1,2 +1,7 @@ -{{- $version := cond (eq (getenv "HUGO_ENV") "production") $.Page.Site.Params.supported_k8s $.Page.Site.Params.dev_supported_k8s }} -{{- $prefix := replace $version "." "-" }}https://v{{- $prefix }}.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v{{- $version }}/{{- .Get "href" }} \ No newline at end of file + +{{- $version := $.Page.Site.Params.supported_k8s }} +{{- if and (ne (getenv "HUGO_ENV") "production") (ne (getenv "HUGO_ENV") "snapshot")}} +{{- $version = $.Page.Site.Params.dev_supported_k8s }} +{{ end }} +{{- $prefix := replace $version "." "-" }}https://v{{- $prefix }}.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v{{- $version }}/{{- .Get "href" }} diff --git a/site/layouts/shortcodes/k8s-version.html b/site/layouts/shortcodes/k8s-version.html index 6e7352b6d8..8fe8b93f5f 100644 --- a/site/layouts/shortcodes/k8s-version.html +++ b/site/layouts/shortcodes/k8s-version.html @@ -1,5 +1,5 @@ -{{- if eq (getenv "HUGO_ENV") "production" }} +{{- if or (eq (getenv "HUGO_ENV") "production") (eq (getenv "HUGO_ENV") "snapshot")}} {{- $.Page.Site.Params.supported_k8s }} {{- else }} {{- $.Page.Site.Params.dev_supported_k8s }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/site/layouts/shortcodes/minikube-k8s-minor-version.html b/site/layouts/shortcodes/minikube-k8s-minor-version.html index c9e71604f1..3106ac6c8c 100644 --- a/site/layouts/shortcodes/minikube-k8s-minor-version.html +++ b/site/layouts/shortcodes/minikube-k8s-minor-version.html @@ -1,5 +1,5 @@ -{{- if eq (getenv "HUGO_ENV") "production" }} +{{- if or (eq (getenv "HUGO_ENV") "production") (eq (getenv "HUGO_ENV") "snapshot")}} {{- $.Page.Site.Params.minikube_minor_supported_k8s }} {{- else }} {{- $.Page.Site.Params.dev_minikube_minor_supported_k8s }} -{{- end }} \ No newline at end of file +{{- end }}