Use good and automatic defaults for tornjak frontend workingDir (#129)

Signed-off-by: Kevin Fox <[email protected]>
Signed-off-by: kfox1111 <[email protected]>
This commit is contained in:
kfox1111
2023-12-11 07:52:44 -08:00
committed by GitHub
parent 7726351955
commit 9f72a8f971
5 changed files with 15 additions and 6 deletions
@@ -84,3 +84,13 @@ Create URL for accessing Tornjak APIs
{{- print "http://localhost:" .Values.service.port }}
{{- end }}
{{- end }}
{{- define "tornjak-frontend.workingDir" }}
{{- if .Values.workingDir }}
{{- .Values.workingDir }}
{{- else if (dig "openshift" false .Values.global) }}
{{- printf "/opt/app-root/src" }}
{{- else }}
{{- printf "/usr/src/app" }}
{{- end }}
{{- end }}
@@ -53,9 +53,9 @@ spec:
{{- end }}
volumeMounts:
- name: cache
mountPath: {{ .Values.workingDir }}/node_modules/.cache
mountPath: {{ include "tornjak-frontend.workingDir" . }}/node_modules/.cache
- name: env
mountPath: {{ .Values.workingDir }}/build/tmp
mountPath: {{ include "tornjak-frontend.workingDir" . }}/build/tmp
- name: logs
mountPath: /opt/app-root/src/.npm/
{{- with .Values.nodeSelector }}