Created
September 1, 2020 18:03
-
-
Save orangewolf/4436c9f31177e89f129d636d31911a3a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: {{ template "app.setup.name" . }} | |
labels: | |
app: {{ template "app.name" . }} | |
chart: {{ template "app.chart" . }} | |
release: {{ .Release.Name }} | |
heritage: {{ .Release.Service }} | |
annotations: | |
# This is what defines this resource as a hook. Without this line, the | |
# job is considered part of the release. | |
"helm.sh/hook": pre-install,pre-upgrade | |
"helm.sh/hook-weight": "-5" | |
"helm.sh/hook-delete-policy": before-hook-creation | |
spec: | |
backoffLimit: 4 | |
template: | |
metadata: | |
labels: | |
app: {{ template "app.name" . }} | |
release: {{ .Release.Name }} | |
spec: | |
restartPolicy: Never | |
{{- if .Values.rails.imagePullSecrets }} | |
imagePullSecrets: | |
{{ toYaml .Values.rails.imagePullSecrets }} | |
{{- end }} | |
volumes: | |
- name: shared | |
persistentVolumeClaim: | |
claimName: {{ template "app.rails-env.name" . }}-shared | |
containers: | |
- name: setup | |
image: {{ .Values.rails.image.repository }}:{{ .Values.rails.image.tag }} | |
volumeMounts: | |
- mountPath: /app/public/assets | |
name: shared | |
subPath: assets | |
- mountPath: /app/public/packs | |
name: shared | |
subPath: packs | |
- mountPath: /app/public/system | |
name: shared | |
subPath: system | |
command: ["/bin/bash"] | |
args: | |
- "-l" | |
- "-c" | |
- "./chart/bin/solr-setup && RAILS_ENV=production bundle exec rails db:create db:migrate db:seed && echo SETUP COMPLETE" | |
envFrom: | |
- configMapRef: | |
name: {{ template "app.rails-env.name" . }} | |
- secretRef: | |
name: {{ template "app.rails-env.name" . }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment