chore(oss): audit the console package and the Helm chart
Add the dist/migrate.js entrypoint the Helm job already invoked and point Compose at the same runner, so one implementation applies packages/server/migrations in both paths. Rewrite the console README to the standalone Docker build it actually uses and fix the chart description. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
This commit is contained in:
1 parent
bc6983a62e
commit
f69350d709
7 files changed
+76
-34
No files matched your search
+5
-20
@@ -77,29 +77,14 @@ services:
|
||||
# DB migrate: applies packages/server/migrations
|
||||
# ============================================================
|
||||
db-migrate:
|
||||
image: postgres:16-alpine
|
||||
build:
|
||||
context: ./packages/server
|
||||
dockerfile: Dockerfile
|
||||
command: ["node", "dist/migrate.js"]
|
||||
env_file: .env
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
PGPASSWORD: ${POSTGRES_PASSWORD:-elydora-secret-change-me}
|
||||
volumes:
|
||||
- ./packages/server/migrations:/migrations:ro,z
|
||||
entrypoint: ["sh", "-c"]
|
||||
command:
|
||||
- |
|
||||
set -e
|
||||
PSQL="psql -h postgres -U ${POSTGRES_USER:-elydora} -d ${POSTGRES_DB:-elydora}"
|
||||
for file in /migrations/*.sql; do
|
||||
version=$$(basename "$$file" | cut -d_ -f1 | sed 's/^0*//')
|
||||
applied=$$($$PSQL -tAX -c "SELECT 1 FROM schema_versions WHERE version = $$version" 2>/dev/null || true)
|
||||
if [ "$$applied" = "1" ]; then
|
||||
echo "Skipping $$file (already applied)"
|
||||
continue
|
||||
fi
|
||||
echo "Applying $$file"
|
||||
$$PSQL -v ON_ERROR_STOP=1 -f "$$file"
|
||||
done
|
||||
|
||||
api:
|
||||
build:
|
||||
|
||||
Reference in new issue
Block a user