Last active
January 19, 2021 20:15
-
-
Save mficzel/350fa4e2df2a02da9210904c05630287 to your computer and use it in GitHub Desktop.
Kubernetes Green / Blue deployment with Helm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{/* | |
Create revion color "green" / "blue" from release number | |
*/}} | |
{{- define "project.revisioncolor" -}} | |
{{- if mod .Release.Revision 2 -}} | |
{{- printf "green" -}} | |
{{- else -}} | |
{{- printf "blue" -}} | |
{{- end -}} | |
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spec: | |
template: | |
spec: | |
containers: | |
... | |
env: | |
- name: STATIC_PUBLISHING_DIRECTORY | |
value: "{{ .Values.staticBasePath }}/{{ include "project.revisioncolor" . }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment