Files
cloudy/cluster/code-server/templates/scripts.yaml
T

27 lines
627 B
YAML

{{- if not (empty .Values.repositories) -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-scripts" (include "code-server.fullname" .) }}
labels:
{{- include "code-server.labels" . | nindent 4 }}
data:
repo-updater.sh: |
#!/bin/sh
# update the given repository
update() {
if [ ! -d "$1/.git" ]
then
git clone "$2" "$1"
else
cd "$1" && git fetch && git pull "$2"
fi
}
# list of repositories to update
{{- range $i, $repo := .Values.repositories }}
update "{{ $repo.name }}" "{{ $repo.url }}"
{{- end }}
{{- end }}