mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-10 21:48:48 +08:00
67 lines
2.5 KiB
YAML
67 lines
2.5 KiB
YAML
{{ if .Values.app.copilot.enabled }}
|
|
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: {{ include "graphql.fullname" . }}-copilot-test
|
|
labels:
|
|
{{- include "graphql.labels" . | nindent 4 }}
|
|
annotations:
|
|
"helm.sh/hook": post-install,post-upgrade
|
|
"helm.sh/hook-weight": "1"
|
|
"helm.sh/hook-delete-policy": before-hook-creation
|
|
spec:
|
|
schedule: "0 8 * * *"
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
spec:
|
|
serviceAccountName: {{ include "graphql.serviceAccountName" . }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
command: ["yarn", "test:copilot:e2e:cron"]
|
|
env:
|
|
- name: AFFINE_ENV
|
|
value: "{{ .Release.Namespace }}"
|
|
- name: SLACK_BOT_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: "{{ .Values.app.copilot.secretName }}"
|
|
key: slackBotToken
|
|
- name: CHANNEL_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: "{{ .Values.app.copilot.secretName }}"
|
|
key: slackChannelId
|
|
- name: COPILOT_E2E_ENDPOINT
|
|
value: "http://{{ include "graphql.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:3000"
|
|
- name: DATABASE_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: pg-postgresql
|
|
key: postgres-password
|
|
- name: DATABASE_URL
|
|
value: postgres://{{ .Values.global.database.user }}:$(DATABASE_PASSWORD)@{{ .Values.global.database.url }}:{{ .Values.global.database.port }}/{{ .Values.global.database.name }}
|
|
- name: COPILOT_OPENAI_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: "{{ .Values.app.copilot.secretName }}"
|
|
key: openaiSecret
|
|
- name: COPILOT_FAL_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: "{{ .Values.app.copilot.secretName }}"
|
|
key: falSecret
|
|
- name: COPILOT_UNSPLASH_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: "{{ .Values.app.copilot.secretName }}"
|
|
key: unsplashSecret
|
|
resources:
|
|
requests:
|
|
cpu: '100m'
|
|
memory: '200Mi'
|
|
restartPolicy: Never
|
|
backoffLimit: 1
|
|
{{ end }}
|