diff --git a/charts/application-core/Chart.yaml b/charts/application-core/Chart.yaml index 89163e6..0c83042 100644 --- a/charts/application-core/Chart.yaml +++ b/charts/application-core/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 4.2.5 +version: 4.2.6 maintainers: diff --git a/charts/application-core/templates/_helpers.tpl b/charts/application-core/templates/_helpers.tpl index 11192ff..8dac8c9 100644 --- a/charts/application-core/templates/_helpers.tpl +++ b/charts/application-core/templates/_helpers.tpl @@ -5,12 +5,37 @@ Expand the name of the chart. {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} +{{/* +Build the short stage name based off of the namespace +*/}} +{{- define "application-core.shortStage" }} +{{- if contains "-production" .Release.Namespace }} +{{- printf "%s" "prd" }} +{{- else if contains "-performance" .Release.Namespace }} +{{- printf "%s" "perf" }} +{{- else if contains "-integration" .Release.Namespace }} +{{- printf "%s" "int" }} +{{- else if contains "-sandbox" .Release.Namespace }} +{{- printf "%s" "sbx" }} +{{- else if contains "-staging" .Release.Namespace }} +{{- printf "%s" "stg" }} +{{- else if contains "-demo" .Release.Namespace }} +{{- printf "%s" "demo" }} +{{- else if contains "-qa" .Release.Namespace }} +{{- printf "%s" "qa" }} +{{- else if contains "-development" .Release.Namespace }} +{{- printf "%s" "dev" }} +{{- else }} +{{- printf "%s" .Release.Namespace }} +{{- end }} +{{- end }} + {{/* Build the env that gets injected into the deployments */}} {{- define "application-core.env" -}} - name: APP_NAME - value: {{ .Values.appName | default (printf "%s-%s" .Release.Namespace .Release.Name) }} + value: {{ .Values.appName | default (printf "%s-%s" .Release.Name (include "application-core.shortStage" . )) }} {{- if .Values.env }} {{ .Values.env | toYaml }} {{- end }}