Skip to content

Commit ee837fc

Browse files
shortStage (#90)
* adds shortStage helper
1 parent 38f7d9d commit ee837fc

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

charts/application-core/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 4.2.5
18+
version: 4.2.6
1919

2020

2121
maintainers:

charts/application-core/templates/_helpers.tpl

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,37 @@ Expand the name of the chart.
55
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
66
{{- end }}
77

8+
{{/*
9+
Build the short stage name based off of the namespace
10+
*/}}
11+
{{- define "application-core.shortStage" }}
12+
{{- if contains "-production" .Release.Namespace }}
13+
{{- printf "%s" "prd" }}
14+
{{- else if contains "-performance" .Release.Namespace }}
15+
{{- printf "%s" "perf" }}
16+
{{- else if contains "-integration" .Release.Namespace }}
17+
{{- printf "%s" "int" }}
18+
{{- else if contains "-sandbox" .Release.Namespace }}
19+
{{- printf "%s" "sbx" }}
20+
{{- else if contains "-staging" .Release.Namespace }}
21+
{{- printf "%s" "stg" }}
22+
{{- else if contains "-demo" .Release.Namespace }}
23+
{{- printf "%s" "demo" }}
24+
{{- else if contains "-qa" .Release.Namespace }}
25+
{{- printf "%s" "qa" }}
26+
{{- else if contains "-development" .Release.Namespace }}
27+
{{- printf "%s" "dev" }}
28+
{{- else }}
29+
{{- printf "%s" .Release.Namespace }}
30+
{{- end }}
31+
{{- end }}
32+
833
{{/*
934
Build the env that gets injected into the deployments
1035
*/}}
1136
{{- define "application-core.env" -}}
1237
- name: APP_NAME
13-
value: {{ .Values.appName | default (printf "%s-%s" .Release.Namespace .Release.Name) }}
38+
value: {{ .Values.appName | default (printf "%s-%s" .Release.Name (include "application-core.shortStage" . )) }}
1439
{{- if .Values.env }}
1540
{{ .Values.env | toYaml }}
1641
{{- end }}

0 commit comments

Comments
 (0)