Add ssh flag

This commit is contained in:
Guilhem Lavaux 2024-12-04 22:07:01 +01:00
parent d8e86f17cf
commit 1317be06c9
3 changed files with 31 additions and 5 deletions

View File

@ -4,8 +4,8 @@ name: basic-web-app
PullName: basic-app-puller
description: A basic Helm chart to have PHP webapps in Kubernetes. It supports webhook for pulling from gitea
type: application
version: 2.0.0
appVersion: "2.0.0"
version: 2.1.0
appVersion: "2.1.0"
dependencies:
- name: postgresql

View File

@ -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 }}

View File

@ -15,8 +15,12 @@ updater:
image:
repository: glvx/web-updater
pullPolicy: IfNotPresent
tag: "241120-1"
tag: "241204"
url: "https://git.aquila-consortium.org/guilhem_lavaux/gl-website-deployer"
ssh:
enabled: false
secretName: ""
webhook-secret: ""
apiUsername: ""
apiPassword: ""