Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(workflows): install postgresql to kind cluster #35

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,26 @@ jobs:
fi

- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.9.0

- name: Deploy
run: |
tee -a values.ci.yaml << END
primary:
initdb:
scripts:
initialize_backend.sql: |
CREATE USER backend PASSWORD 'backend';
CREATE DATABASE backend OWNER backend;
initialize_auth.sql: |
CREATE USER auth PASSWORD 'auth';
CREATE DATABASE auth OWNER auth;
END
golobitch marked this conversation as resolved.
Show resolved Hide resolved
helm install postgresql oci://registry-1.docker.io/bitnamicharts/postgresql -f values.ci.yaml

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
4 changes: 2 additions & 2 deletions charts/rafiki-auth/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ 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: 0.4.1
version: 0.4.2

# 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.
# It is recommended to use it with quotes.
appVersion: 'v1.0.0-alpha.5'
appVersion: 'v1.0.0-alpha.8'
7 changes: 6 additions & 1 deletion charts/rafiki-auth/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ spec:
initContainers:
- name: database-migrations
image: {{ include "auth.image" . }}
command: ["npm", "run", "knex -- migrate:latest --env production"]
command: ["npm", "run", "knex", "--", "migrate:latest", "--env", "production"]
workingDir: /home/rafiki/packages/auth/
envFrom:
- configMapRef:
name: {{ include "rafiki-auth.fullname" . }}
- secretRef:
name: {{ include "rafiki-auth.fullname" . }}-secrets
{{- end }}
containers:
- name: {{ .Chart.Name }}
Expand Down
6 changes: 3 additions & 3 deletions charts/rafiki-auth/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ nodeEnv: development
logLevel: debug
enableManualMigrations: true
postgresql:
host: "postgres.example.com"
host: "postgresql.default"
port: 5432
username: "auth"
database: "auth"
password: "changeme" # override this value
password: "auth" # override this value
golobitch marked this conversation as resolved.
Show resolved Hide resolved
port:
admin: 3003
auth: 3006
Expand All @@ -27,7 +27,7 @@ workers:
cleanup: 1
image:
repository: ghcr.io/interledger/rafiki-auth
tag: 'v1.0.0-alpha.3'
tag: 'v1.0.0-alpha.8'
digest: ''
pullPolicy: IfNotPresent
rollingUpdate:
Expand Down
4 changes: 2 additions & 2 deletions charts/rafiki-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ 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: 0.4.2
version: 0.4.3

# 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.
# It is recommended to use it with quotes.
appVersion: 'v1.0.0-alpha.5'
appVersion: 'v1.0.0-alpha.8'
7 changes: 6 additions & 1 deletion charts/rafiki-backend/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ spec:
initContainers:
- name: database-migrations
image: {{ include "backend.image" . }}
command: ["npm", "run", "knex -- migrate:latest --env production"]
command: ["npm", "run", "knex", "--", "migrate:latest", "--env", "production"]
workingDir: /home/rafiki/packages/backend/
envFrom:
- configMapRef:
name: {{ include "rafiki-backend.fullname" . }}
- secretRef:
name: {{ include "rafiki-backend.fullname" . }}-secrets
{{- end }}
containers:
- name: {{ .Chart.Name }}
Expand Down
6 changes: 3 additions & 3 deletions charts/rafiki-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ redis:
tlsCertFile: ''
tlsKeyFile: ''
postgresql:
host: "postgres.example.com"
host: "postgresql.default"
port: 5432
username: "backend"
database: "backend"
password: "overridethisValue"
password: "backend"
port:
admin: 3001
connector: 3002
Expand Down Expand Up @@ -50,7 +50,7 @@ idempotency:
keyLock: 2000
image:
repository: ghcr.io/interledger/rafiki-backend
tag: 'v1.0.0-alpha.3'
tag: 'v1.0.0-alpha.8'
digest: ''
pullPolicy: IfNotPresent
rollingUpdate:
Expand Down
4 changes: 2 additions & 2 deletions charts/rafiki-frontend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ 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: 0.4.1
version: 0.4.2

# 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.
# It is recommended to use it with quotes.
appVersion: 'v1.0.0-alpha.5'
appVersion: 'v1.0.0-alpha.8'
2 changes: 1 addition & 1 deletion charts/rafiki-frontend/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ metadata:
data:
GRAPHQL_URL: "{{ .Values.serviceUrls.GRAPHQL_URL}}"
LOG_LEVEL: debug
NODE_ENV: development
NODE_ENV: "{{ .Values.nodeEnv }}"
PORT: "{{ .Values.port }}"
3 changes: 2 additions & 1 deletion charts/rafiki-frontend/values.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
nodeEnv: production
serviceUrls:
GRAPHQL_URL: http://rafiki-backend:3001/graphql
port: 3010
image:
repository: ghcr.io/interledger/rafiki-frontend
tag: 'v1.0.0-alpha.3'
tag: 'v1.0.0-alpha.8'
digest: ''
pullPolicy: IfNotPresent
rollingUpdate:
Expand Down