Skip to content

Commit

Permalink
chore: add option to manually specify migration container command
Browse files Browse the repository at this point in the history
  • Loading branch information
levivannoort committed Dec 1, 2024
1 parent ada01a8 commit 8360712
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: server
description: A Helm chart for the server component of Amplication

type: application
version: 2.0.10
version: 2.0.11
appVersion: "0.0.0"

sources:
Expand Down
2 changes: 1 addition & 1 deletion server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh"]
args: ["-c", "npx prisma migrate deploy --schema prisma/schema.prisma", ";", "exit"]
args: ["-c", {{ .Values.initContainer.args | quote }}, ";", "exit"]
env:
- name: POSTGRESQL_URL
valueFrom:
Expand Down
4 changes: 4 additions & 0 deletions server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ strategy:
maxUnavailable: 0
type: RollingUpdate

## Configuration for specifying a differenct command to execute schema migrations
initContainer:
args: "npx [email protected] migrate deploy --schema prisma/schema.prisma"

## @param cronJob.graphql.enabled Whether to enable the graphql cronjob
## @param cronJob.graphql.schedule The unix style cronjob timer
## @param cronJob.graphql.history.successful Determine how many successful jobs to keep
Expand Down

0 comments on commit 8360712

Please sign in to comment.