fix: use Python asyncpg migration runner instead of psql, remove postgresql-client from image
This commit is contained in:
@@ -33,17 +33,7 @@ spec:
|
||||
- name: run-migrations
|
||||
image: {{ $root.Values.image.registry }}/{{ $svc.image }}:{{ $root.Values.image.tag }}
|
||||
imagePullPolicy: {{ $root.Values.image.pullPolicy }}
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
- |
|
||||
for f in $(ls /app/infra/migrations/*.sql 2>/dev/null | sort); do
|
||||
echo "Applying $(basename $f)..."
|
||||
PGPASSWORD="$POSTGRES_PASSWORD" psql \
|
||||
-h "$POSTGRES_HOST" -p "$POSTGRES_PORT" \
|
||||
-U "$POSTGRES_USER" -d "$POSTGRES_DB" \
|
||||
-f "$f" -v ON_ERROR_STOP=0 2>&1 | tail -1 || true
|
||||
done
|
||||
echo "Migrations complete."
|
||||
command: ["python", "-m", "services.shared.migrate"]
|
||||
securityContext:
|
||||
{{- include "stonks.containerSecurityContext" $root | nindent 12 }}
|
||||
envFrom:
|
||||
|
||||
Reference in New Issue
Block a user