Skip to content

Commit

Permalink
add novu sync job (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem authored Jan 29, 2025
1 parent 990cc67 commit e6b2bc0
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 28 deletions.
2 changes: 1 addition & 1 deletion charts/phrasea/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.1.0
version: 2.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
29 changes: 29 additions & 0 deletions charts/phrasea/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,32 @@ envFrom:
name: {{ $secretName }}
key: {{ $mapping.secretKey }}
{{- end }}

{{- define "novuBridge.containerSpecs" -}}
image: {{ .Values.repository.baseurl }}/ps-novu-bridge:{{ .Values.repository.tag }}
{{- if not (eq "latest" .Values.repository.tag) }}
imagePullPolicy: Always
{{- end }}
terminationMessagePolicy: FallbackToLogsOnError
env:
- name: NEXT_PUBLIC_NOVU_SECRET_KEY
valueFrom:
secretKeyRef:
name: novu
key: NOVU_SECRET_KEY
- name: NEXT_PUBLIC_NOVU_APPLICATION_IDENTIFIER
valueFrom:
configMapKeyRef:
name: novu
key: NOVU_APPLICATION_IDENTIFIER
- name: NEXT_PUBLIC_NOVU_API_URL
valueFrom:
configMapKeyRef:
name: novu
key: NOVU_API_URL
envFrom:
- configMapRef:
name: novu
- secretRef:
name: novu
{{- end }}
28 changes: 1 addition & 27 deletions charts/phrasea/templates/novu/novu-bridge-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,7 @@ spec:
{{- if $.Values.nodeSelector }}
nodeSelector: {{ toYaml $.Values.nodeSelector | nindent 8 }}
{{- end }}
volumes:
containers:
- name: novu-bridge
image: {{ $.Values.repository.baseurl }}/ps-novu-bridge:{{ $.Values.repository.tag }}
{{- if not (eq "latest" $.Values.repository.tag) }}
imagePullPolicy: Always
{{- end }}
terminationMessagePolicy: FallbackToLogsOnError
env:
- name: NEXT_PUBLIC_NOVU_SECRET_KEY
valueFrom:
secretKeyRef:
name: novu
key: NOVU_SECRET_KEY
- name: NEXT_PUBLIC_NOVU_APPLICATION_IDENTIFIER
valueFrom:
configMapKeyRef:
name: novu
key: NOVU_APPLICATION_IDENTIFIER
- name: NEXT_PUBLIC_NOVU_API_URL
valueFrom:
configMapKeyRef:
name: novu
key: NOVU_API_URL
envFrom:
- configMapRef:
name: novu
- secretRef:
name: novu
{{- include "novuBridge.containerSpecs" $ | nindent 8 }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/phrasea/templates/novu/novu-sync-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: batch/v1
kind: Job
metadata:
name: novu-sync
annotations:
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
spec:
{{ include "imagePullSecrets" $ | indent 6 }}
{{- if $.Values.nodeSelector }}
nodeSelector: {{ toYaml $.Values.nodeSelector | nindent 8 }}
{{- end }}
containers:
- name: novu-sync-job
{{- include "novuBridge.containerSpecs" $ | nindent 8 }}
args: ["pnpm", "sync"]
restartPolicy: Never
backoffLimit: 0

0 comments on commit e6b2bc0

Please sign in to comment.