Skip to content

Commit

Permalink
Adds snapshot Hugo env to separate from default production env
Browse files Browse the repository at this point in the history
Updates shortcodes to use supported K8s version for snapshot environment
  • Loading branch information
igooch committed Jan 23, 2023
1 parent 713a76e commit 9dd9c82
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions build/includes/release.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

2 changes: 1 addition & 1 deletion build/includes/website.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
diff -bB /tmp/result.sorted /tmp/generated.html.sorted
4 changes: 2 additions & 2 deletions site/layouts/shortcodes/aks-k8s-minor-version.html
Original file line number Diff line number Diff line change
@@ -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 }}
{{- end }}
9 changes: 7 additions & 2 deletions site/layouts/shortcodes/k8s-api.html
Original file line number Diff line number Diff line change
@@ -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" }}
<!-- $version must be assigned outside of if statement for variable scope purposes.
Default to "supported_k8s" version. -->
{{- $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" }}
4 changes: 2 additions & 2 deletions site/layouts/shortcodes/k8s-version.html
Original file line number Diff line number Diff line change
@@ -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 }}
{{- end }}
4 changes: 2 additions & 2 deletions site/layouts/shortcodes/minikube-k8s-minor-version.html
Original file line number Diff line number Diff line change
@@ -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 }}
{{- end }}

0 comments on commit 9dd9c82

Please sign in to comment.