Files
factorio-signal-exporter/web/charts/factorio-dashboard/templates/_helpers.tpl
Caesar2011 e4e9ebd737
Some checks failed
Build & Push / build (push) Failing after 5m41s
feat: add Dockerfile, Helm chart, Gitea Actions workflow
2026-05-17 20:36:29 +02:00

50 lines
1.4 KiB
Smarty

{{/*
Expand the name of the chart.
*/}}
{{- define "factorio-dashboard.name" -}}
{{- .Chart.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a fully qualified app name.
*/}}
{{- define "factorio-dashboard.fullname" -}}
{{- printf "%s" (include "factorio-dashboard.name" .) | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels.
*/}}
{{- define "factorio-dashboard.labels" -}}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
app.kubernetes.io/name: {{ include "factorio-dashboard.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels.
*/}}
{{- define "factorio-dashboard.selectorLabels" -}}
app.kubernetes.io/name: {{ include "factorio-dashboard.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Name of the secret that holds API_TOKEN and DATABASE_URL.
*/}}
{{- define "factorio-dashboard.secretName" -}}
{{- if .Values.app.existingSecret }}
{{- .Values.app.existingSecret }}
{{- else }}
{{- include "factorio-dashboard.fullname" . }}-secret
{{- end }}
{{- end }}
{{/*
Construct DATABASE_URL from db values.
*/}}
{{- define "factorio-dashboard.databaseUrl" -}}
{{- printf "postgresql://%s:%s@%s-db:%d/%s" .Values.db.user .Values.db.password (include "factorio-dashboard.fullname" .) (int .Values.db.port) .Values.db.name }}
{{- end }}