Skip to content

Commit

Permalink
wip: Add migrate analytics data job
Browse files Browse the repository at this point in the history
  • Loading branch information
gagantrivedi committed Jun 5, 2024
1 parent d04fcc2 commit d0aa418
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
24 changes: 24 additions & 0 deletions charts/flagsmith/templates/jobs-migrate-analytics-data.yaml
Original file line number Diff line number Diff line change
@@ -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 -}}
3 changes: 3 additions & 0 deletions charts/flagsmith/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d0aa418

Please sign in to comment.