Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,3 @@ jobs:
secrets:
aws_deployment_account_id: ${{ secrets.AWS_DEV_ACCOUNT_ID }}
secrets_account_id: ${{ secrets.SECRETS_ACCOUNT_ID }}

4 changes: 3 additions & 1 deletion deploy/helm/environments/common/admin.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ serviceMonitors:
- name: admin-pm2-metrics
port: pm2-metrics
interval: 30s
path: /metrics
path: /metrics

enable_db_migrations: true
2 changes: 1 addition & 1 deletion deploy/helm/environments/common/dapp.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ image:
repository: radixdlt/fullstack-dapp-example-dapp
tag: {{ .StateValues.ci.tag }}

enable_db_migrations: true


service:
port: 3000
Expand Down
2 changes: 2 additions & 0 deletions deploy/helm/environments/demo/admin.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ ingress:
paths:
- path: /
pathType: ImplementationSpecific

dbSeed: true
1 change: 1 addition & 0 deletions deploy/helm/environments/demo/dapp.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ ingress:
paths:
- path: /
pathType: ImplementationSpecific

2 changes: 2 additions & 0 deletions deploy/helm/environments/pr/admin.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ ingress:
paths:
- path: /
pathType: ImplementationSpecific

dbSeed: true
1 change: 1 addition & 0 deletions deploy/helm/environments/pr/dapp.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ ingress:
paths:
- path: /
pathType: ImplementationSpecific

6 changes: 5 additions & 1 deletion deploy/helm/fullstack-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh", "-c", "-e"]
args:
{{- if eq (default .Values.dbSeed false) true }}
- npx prisma migrate deploy --schema packages/database/prisma/schema.prisma && cd packages/database && npx prisma db seed
{{- else }}
- npx prisma migrate deploy --schema packages/database/prisma/schema.prisma
{{- end }}
env:
{{- range $secret := .Values.secrets }}
- name: {{ $secret.env_variable }}
Expand All @@ -52,7 +56,7 @@ spec:
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down
4 changes: 4 additions & 0 deletions dockerfiles/dapp.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ COPY --from=build /app/apps/ apps
COPY --from=build /app/packages/ packages
COPY --from=build /app/node_modules node_modules

COPY --from=build /app/packages/database/src/ .

RUN npx prisma generate

RUN npm install pm2 -g && \
pm2 install pm2-metrics

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"apps/*",
"packages/*"
],
"prisma":{
"prisma": {
"seed": "tsx packages/database/prisma/seed.ts"
}
}
}
3 changes: 2 additions & 1 deletion packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"@prisma/extension-read-replicas": "^0.4.0"
},
"devDependencies": {
"prisma": "^5.15.0"
"prisma": "^5.15.0",
"tsx" : "^4.19.2"
},
"prisma": {
"seed": "tsx prisma/seed.ts"
Expand Down
Loading