Skip to content

Commit

Permalink
fix: improve tests hasura
Browse files Browse the repository at this point in the history
  • Loading branch information
mosoriob committed Sep 4, 2024
1 parent 38a6fcc commit 619552e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/mint/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.3.1-alpha.0
version: 3.3.1-alpha.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
Expand Down
10 changes: 7 additions & 3 deletions charts/mint/templates/hasura.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ spec:
secretKeyRef:
name: {{ include "mint.prefix" . }}-hasura-secrets
key: jwt_secret
- name: DB_HOST
value: {{ include "mint.prefix" $ }}-hasura
ports:
- name: http
containerPort: 8080
Expand All @@ -84,9 +86,11 @@ spec:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
exec:
command:
- /bin/sh
- -c
- pg_isready -h localhost -p 5432
- name: hasura-db
#if the values.arm_support is true, then use the arm_image, otherwise use the image
{{- if .Values.arm_support }}
Expand Down
18 changes: 17 additions & 1 deletion charts/mint/templates/post-install-hasura.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,26 @@ spec:
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
restartPolicy: Never
initContainers:
- name: wait-for-db
image: busybox
command: ['sh', '-c', 'until nc -z ${DB_HOST} 5432; do echo waiting for db; sleep 2; done;']
env:
- name: DB_HOST
value: {{ include "mint.prefix" $ }}-hasura
- name: DB_PORT
value: "5432"
- name: DB_NAME
value: ALL
- name: DB_USER
valueFrom:
secretKeyRef:
name: {{ include "mint.prefix" . }}-hasura-secrets
key: username
containers:
- name: post-install-hasura
command: ["/bin/bash"]
args: ["-c", "env && hasura migrate apply && hasura metadata apply && hasura seeds apply"]
args: ["-c", "env && pushd /hasura && hasura migrate apply && hasura metadata apply && hasura seeds apply"]
{{- with .Values.components.hasura }}
image: "{{ .image.repository }}:{{ .image.tag | default $.Chart.AppVersion }}"
resources:
Expand Down
2 changes: 1 addition & 1 deletion charts/mint/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ components:
enabled: true
image:
repository: mintproject/graphql-engine
tag: 0fc7ce2a5098d2e86f1280f6fa70acfc816a531d
tag: 305c0dbeba1878eafe348f21fc300fbfc017d9dc
pullPolicy: IfNotPresent
resources: {}
environment:
Expand Down

0 comments on commit 619552e

Please sign in to comment.