Skip to content

Commit

Permalink
fix: Use file-server container for db upgrade job (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb committed Feb 29, 2024
2 parents 228c7d9 + 2e1e485 commit 60d1ba0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion file-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ LABEL org.label-schema.name="FlowFuse File Storage" \

EXPOSE 3001

CMD ["./node_modules/.bin/ff-file-storage"]
CMD ["./node_modules/.bin/ff-file-storage"]
4 changes: 2 additions & 2 deletions helm/flowforge/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 11.9.13
digest: sha256:ea11617d363e174146b33ceafb5e2072d36731c2446178a91e5e6f705d0db067
generated: "2023-11-15T14:44:27.496269+01:00"
digest: sha256:1423e37aa789fccab1a4b5db593ccda3887032de2a4814b928df938f6db1de3a
generated: "2024-02-13T12:15:48.820039+01:00"
3 changes: 3 additions & 0 deletions helm/flowforge/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ dependencies:
version: 11.9.13
repository: https://charts.bitnami.com/bitnami
condition: forge.localPostgresql
import-values:
- child: image
parent: postgresql.image
maintainers:
- name: "FlowForge Inc"
url: "https://flowfuse.com"
Expand Down
6 changes: 3 additions & 3 deletions helm/flowforge/templates/job-upgrade-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ metadata:
data:
upgrade.sh: |
#!/bin/sh
apk add --no-cache postgresql14-client
psql -v ON_ERROR_STOP=1 -h {{ include "forge.databaseHost" . }} -U postgres postgres <<-ESQL
# apk add --no-cache postgresql14-client
psql -v ON_ERROR_STOP=1 -h {{ .Release.Name }}-postgresql -U postgres postgres <<-ESQL
SELECT datname FROM pg_database WHERE datistemplate = false;
SELECT 'CREATE DATABASE "ff-context"' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'ff-context')\gexec
GRANT ALL PRIVILEGES ON DATABASE "ff-context" TO "forge";
Expand All @@ -35,7 +35,7 @@ spec:
restartPolicy: Never
containers:
- name: add-context-db
image: "alpine:3.17.0"
image: {{ .Values.postgresql.image.registry }}/{{ .Values.postgresql.image.repository }}/{{ .Values.postgresql.image.tag }}
env:
- name: PGPASSWORD
valueFrom:
Expand Down

0 comments on commit 60d1ba0

Please sign in to comment.