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

fix: Use file-server container for db upgrade job #307

Merged
merged 7 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
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"
hardillb marked this conversation as resolved.
Show resolved Hide resolved
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://flowforge.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,7 +8,7 @@ metadata:
data:
upgrade.sh: |
#!/bin/sh
apk add --no-cache postgresql14-client
# 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
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 All @@ -52,4 +52,4 @@ spec:
- name: upgrade-script
configMap:
name: upgrade.sh
{{- end -}}
{{- end -}}
Loading