Add ssh flag
This commit is contained in:
parent
d8e86f17cf
commit
1317be06c9
3 changed files with 31 additions and 5 deletions
|
@ -22,14 +22,22 @@ spec:
|
|||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: "/web"
|
||||
{{- if .Values.updater.ssh.enabled }}
|
||||
- name: ssh-key
|
||||
mountPath: "/ssh-key"
|
||||
readOnly: true
|
||||
{{- end}}
|
||||
command:
|
||||
- /bin/sh
|
||||
- -ec
|
||||
- |
|
||||
cd /web
|
||||
test -d .git && exit 0
|
||||
{{- if .Values.updater.ssh.enabled }}
|
||||
git clone ${GIT_URL} . --config core.sshCommand="ssh -i /ssh-key"
|
||||
{{- else }}
|
||||
git clone ${GIT_URL} .
|
||||
mkdir lib/config
|
||||
{{- end}}
|
||||
git lfs install
|
||||
git lfs pull
|
||||
env:
|
||||
|
@ -78,7 +86,11 @@ spec:
|
|||
- name: updater
|
||||
image: "{{ .Values.updater.image.repository }}:{{ .Values.updater.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.updater.image.pullPolicy }}
|
||||
command: ["/webhook-runner.sh"]
|
||||
{{- if .Values.updater.ssh.enabled }}
|
||||
command: ["/webhook-runner.sh ssh"]
|
||||
{{- else }}
|
||||
command: ["/webhook-runner.sh http"]
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
protocol: TCP
|
||||
|
@ -86,6 +98,11 @@ spec:
|
|||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /web
|
||||
{{- if .Values.updater.ssh.enabled }}
|
||||
- name: ssh-key
|
||||
mountPath: "/ssh-key"
|
||||
readOnly: true
|
||||
{{- end}}
|
||||
env:
|
||||
- name: "DATA_DIR"
|
||||
value: "/web"
|
||||
|
@ -126,3 +143,8 @@ spec:
|
|||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Release.Name }}-pvc
|
||||
{{- if .Values.updater.ssh.enabled }}
|
||||
- name: ssh-key
|
||||
secret:
|
||||
secretName: {{ .Values.updater.ssh.secretName }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue