fix: support .env file
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
fbb66d867b
commit
286e8945a2
@ -35,16 +35,31 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- if and (hasKey .Values.envFile "content") (hasKey .Values.config "DRONE_RUNNER_ENV_FILE") }}
|
||||||
nodeSelector:
|
volumeMounts:
|
||||||
{{- toYaml . | nindent 8 }}
|
- name: env-file
|
||||||
|
mountPath: {{ dir .Values.config.DRONE_RUNNER_ENV_FILE }}
|
||||||
|
readOnly: true
|
||||||
{{- end}}
|
{{- end}}
|
||||||
{{- with .Values.affinity }}
|
{{- with .Values.affinity }}
|
||||||
affinity:
|
affinity:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with .Values.nodeSelector }}
|
||||||
|
nodeSelector:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
serviceAccountName: {{ include "droneRunner.fullname" . }}
|
||||||
{{- with .Values.tolerations }}
|
{{- with .Values.tolerations }}
|
||||||
tolerations:
|
tolerations:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
serviceAccountName: {{ include "droneRunner.fullname" . }}
|
{{- if and (hasKey .Values.envFile "content") (hasKey .Values.config "DRONE_RUNNER_ENV_FILE") }}
|
||||||
|
volumes:
|
||||||
|
- name: env-file
|
||||||
|
configMap:
|
||||||
|
name: {{ include "droneRunner.fullname" . }}
|
||||||
|
items:
|
||||||
|
- key: {{ base .Values.config.DRONE_RUNNER_ENV_FILE }}
|
||||||
|
path: {{ base .Values.config.DRONE_RUNNER_ENV_FILE }}
|
||||||
|
{{- end}}
|
||||||
|
11
templates/envConfig.yaml
Normal file
11
templates/envConfig.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{{- if and (hasKey .Values.envFile "content") (hasKey .Values.config "DRONE_RUNNER_ENV_FILE") }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
{{- include "droneRunner.labels" . | nindent 4 }}
|
||||||
|
name: {{ include "droneRunner.fullname" . }}
|
||||||
|
data:
|
||||||
|
{{ base .Values.config.DRONE_RUNNER_ENV_FILE }}: |
|
||||||
|
{{ .Values.envFile.content }}
|
||||||
|
{{- end }}
|
@ -13,6 +13,10 @@ stringData:
|
|||||||
{{- $_ := set .Values.config "DRONE_NAMESPACE_DEFAULT" .Release.Namespace -}}
|
{{- $_ := set .Values.config "DRONE_NAMESPACE_DEFAULT" .Release.Namespace -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if and (not (hasKey .Values.config "DRONE_RUNNER_ENV_FILE")) (hasKey .Values.envFile "content") }}
|
||||||
|
{{- $_ := set .Values.config "DRONE_RUNNER_ENV_FILE" "/tmp/drone-runner/drone.conf" -}}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
{{/* SETUP CONFIG */}}
|
{{/* SETUP CONFIG */}}
|
||||||
{{ range $key, $value := .Values.config }}
|
{{ range $key, $value := .Values.config }}
|
||||||
{{ upper $key}}: {{ quote $value }}
|
{{ upper $key}}: {{ quote $value }}
|
||||||
|
@ -334,6 +334,12 @@ config:
|
|||||||
# https://docs.drone.io/runner/kubernetes/configuration/reference/drone-ui-username/
|
# https://docs.drone.io/runner/kubernetes/configuration/reference/drone-ui-username/
|
||||||
# DRONE_UI_USERNAME: ""
|
# DRONE_UI_USERNAME: ""
|
||||||
|
|
||||||
|
envFile: {}
|
||||||
|
# content: |
|
||||||
|
# KEY=VALUE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
resources: {}
|
resources: {}
|
||||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
# choice for the user. This also increases chances charts run on environments with little
|
# choice for the user. This also increases chances charts run on environments with little
|
||||||
|
Loading…
Reference in New Issue
Block a user