Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Job to run database migrations #45

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion charts/studio/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
1. Get the application URL by running these commands:
{{- if .Values.studioUi.ingress.enabled }}
http{{ if $.Values.studioUi.ingress.tlsEnabled }}s{{ end }}://{{ .Values.studioUi.ingress.host }}/
{{- end }}
{{- else if contains "NodePort" .Values.studioUi.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "studio.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
Expand Down
288 changes: 0 additions & 288 deletions charts/studio/templates/_env_vars.tpl

This file was deleted.

7 changes: 7 additions & 0 deletions charts/studio/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,10 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "studio.checkSum" }}
checksum/configmap-studio: {{ include (print $.Template.BasePath "/configmap-studio.yaml") . | sha256sum }}
checksum/configmap-ca-cert: {{ include (print $.Template.BasePath "/configmap-ca-cert.yaml") . | sha256sum }}
checksum/secret-studio: {{ include (print $.Template.BasePath "/secret-studio.yaml") . | sha256sum }}
checksum/studio-migration-job-secret: {{ include (print $.Template.BasePath "/secret-migration-job.yaml") . | sha256sum }}
{{- end }}
67 changes: 67 additions & 0 deletions charts/studio/templates/configmap-studio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: studio
data:
NO_MIGRATE_DB: "1"
WAIT_FOR_MIGRATIONS: "1"
ALLOWED_HOSTS: "*"
API_URL: "http{{ if $.Values.studioBackend.ingress.tlsEnabled }}s{{ end }}://{{ .Values.studioBackend.ingress.host }}/"
UI_URL: "http{{ if $.Values.studioUi.ingress.tlsEnabled }}s{{ end }}://{{ .Values.studioUi.ingress.host }}/"

BITBUCKET_URL: {{.Values.global.scmProviders.bitbucket.url | default "" | quote }}
BITBUCKET_API_URL: {{ .Values.global.scmProviders.bitbucket.apiUrl | default "" | quote}}
BITBUCKET_WEBHOOK_URL: {{ .Values.global.scmProviders.bitbucket.webhookUrl | default "" | quote}}

ENABLE_BLOBVAULT: "True"
{{- if .Values.global.blobvault.endpointUrl }}
BLOBVAULT_ENDPOINT_URL: {{ .Values.global.blobvault.endpointUrl }}
{{- else }}
BLOBVAULT_ENDPOINT_URL: "{{ .Values.minio.fullnameOverride }}.{{ .Release.Namespace }}.svc.cluster.local:9000"
{{- end }}

{{- if .Values.global.blobvault.endpointUrlFe }}
BLOBVAULT_ENDPOINT_URL_FE: {{ .Values.global.blobvault.endpointUrlFe }}
{{- else }}
BLOBVAULT_ENDPOINT_URL_FE: "{{ .Values.minio.fullnameOverride }}.{{ .Release.Namespace }}.svc.cluster.local:9000"
{{- end }}
BLOBVAULT_BUCKET: {{.Values.global.blobvault.bucket | default "" | quote }}
{{- if .Values.global.celery.brokerUrl }}
CELERY_BROKER_URL: {{ .Values.global.celery.brokerUrl }}
{{- else }}
CELERY_BROKER_URL: "redis://{{ .Values.redis.fullnameOverride }}-master.{{ .Release.Namespace }}.svc.cluster.local:6379"
{{- end }}
{{- if .Values.global.celery.resultBackend }}
CELERY_RESULT_BACKEND: {{ .Values.global.celery.resultBackend }}
{{- else }}
CELERY_RESULT_BACKEND: "redis://{{ .Values.redis.fullnameOverride }}-master.{{ .Release.Namespace }}.svc.cluster.local:6379"
{{- end }}
{{- if .Values.global.celery.resultBackend }}
REDIS_URL: {{ .Values.global.celery.resultBackend }}
{{- else }}
REDIS_URL: "redis://{{ .Values.redis.fullnameOverride }}-master.{{ .Release.Namespace }}.svc.cluster.local:6379"
{{- end }}
GITHUB_API_URL: {{ .Values.global.scmProviders.github.apiUrl | default | quote }}
GITHUB_URL: {{ .Values.global.scmProviders.github.url | default "" | quote }}
GITHUB_WEBHOOK_URL: {{ .Values.global.scmProviders.github.webhookUrl | default "" | quote }}
GITLAB_URL: {{ .Values.global.scmProviders.gitlab.url | default "" | quote}}
GITLAB_WEBHOOK_URL: {{ .Values.global.scmProviders.gitlab.webhookUrl | default "" | quote }}
MAX_VIEWS: {{ .Values.global.maxViews | default "" | quote }}
MAX_TEAMS: {{ .Values.global.maxTeams | default "" | quote }}
{{- $scmProviders := list }}
{{- if .Values.global.scmProviders.gitlab.enabled }}
{{- $scmProviders = append $scmProviders "gitlab" }}
{{- end }}
{{- if .Values.global.scmProviders.github.enabled }}
{{- $scmProviders = append $scmProviders "github" }}
{{- end }}
{{- if .Values.global.scmProviders.bitbucket.enabled }}
{{- $scmProviders = append $scmProviders "bitbucket" }}
{{- end }}
SCM_PROVIDERS: {{ $scmProviders | join "," | quote}}
SOCIAL_AUTH_REDIRECT_IS_HTTPS: "False"
{{- if .Values.studioUi.ingress.enabled }}
SOCIAL_AUTH_ALLOWED_REDIRECT_HOSTS: "studio-ui.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioUi.service.port }},studio-backend.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioBackend.service.port }},http{{ if $.Values.studioUi.ingress.tlsEnabled }}s{{ end }}://{{ .Values.studioUi.ingress.host }}/"
{{- else }}
SOCIAL_AUTH_ALLOWED_REDIRECT_HOSTS: "studio-ui.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioUi.service.port }},studio-backend.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioBackend.service.port }}"
{{- end }}
Loading