Apply tracked schema migrations before deployment and test runtime grants
This commit is contained in:
@@ -19,7 +19,11 @@ VALUES ('fixture','00000000-0000-0000-0000-000000000001','existing-google','exis
|
||||
INSERT INTO project_sessions VALUES
|
||||
('existing-session','fixture','00000000-0000-0000-0000-000000000001',now()+interval '1 hour');
|
||||
SQL
|
||||
psql < db/002-platform.sql
|
||||
psql <<'SQLROLE'
|
||||
CREATE ROLE foundry_fixture LOGIN;
|
||||
SQLROLE
|
||||
python3 deploy/migrate.py --container "$container" --database postgres --role foundry_fixture
|
||||
python3 deploy/migrate.py --container "$container" --database postgres --role foundry_fixture
|
||||
psql <<'SQL'
|
||||
DO $$
|
||||
BEGIN
|
||||
@@ -60,5 +64,5 @@ CGO_ENABLED=0 go test -mod=readonly -c -o bin/platform-tests ./internal/platform
|
||||
docker run --rm --network "container:$container" --user 1000:1000 \
|
||||
--read-only --cap-drop ALL --security-opt no-new-privileges \
|
||||
--mount "type=bind,source=$(pwd)/bin/platform-tests,target=/opt/platform-tests,readonly" \
|
||||
-e PLATFORM_TEST_DATABASE_URL=postgres://postgres@127.0.0.1:5432/postgres?sslmode=disable \
|
||||
-e PLATFORM_TEST_DATABASE_URL=postgres://foundry_fixture@127.0.0.1:5432/postgres?sslmode=disable \
|
||||
--entrypoint /opt/platform-tests postgres:17-alpine -test.v
|
||||
|
||||
Reference in New Issue
Block a user