diff --git a/charts/flagsmith/templates/jobs-migrate-analytics-data.yaml b/charts/flagsmith/templates/jobs-migrate-analytics-data.yaml new file mode 100644 index 0000000..9729e31 --- /dev/null +++ b/charts/flagsmith/templates/jobs-migrate-analytics-data.yaml @@ -0,0 +1,24 @@ +{{- if .Values.jobs.migrateAnalyticsData.enabled -}} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ template "flagsmith.fullname" . }}-migrate-analytics-data-{{ .Release.Revision }}-{{ randAlphaNum 5 | lower }} + {{- $annotations := include "flagsmith.annotations" .Values.common }} + {{- with $annotations }} + annotations: + {{- . | nindent 4 }} + {{- end }} + labels: + {{- include "flagsmith.labels" . | nindent 4 }} + app.kubernetes.io/component: job-migrate-analytics-data +spec: + template: + spec: + restartPolicy: Never + containers: + - name: migrate-analytics-data + image: {{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default (printf "%s" .Chart.AppVersion) }} + command: ["python","manage.py", "migrate_analytics"] + env: {{ include (print $.Template.BasePath "/_api_environment.yaml") . | nindent 8 }} + +{{- end -}} diff --git a/charts/flagsmith/values.yaml b/charts/flagsmith/values.yaml index da4f3fc..2f6f124 100644 --- a/charts/flagsmith/values.yaml +++ b/charts/flagsmith/values.yaml @@ -341,6 +341,9 @@ jobs: extraVolumes: [] command: [] args: [] + migrateAnalyticsData: + enabled: true + args: [] # These tests just make non-destructive requests to the services in # the cluster. Enabling this and running helm test is safe.