From 9fb9812736fcc1555e10d067b4e5826aac40f770 Mon Sep 17 00:00:00 2001 From: Kevin Yeh Date: Tue, 24 Sep 2024 12:37:14 -0400 Subject: [PATCH] cleanup --- .github/workflows/dbdocs.yml | 13 +++++++------ Makefile | 9 ++++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dbdocs.yml b/.github/workflows/dbdocs.yml index c825297ca..421f17bdc 100644 --- a/.github/workflows/dbdocs.yml +++ b/.github/workflows/dbdocs.yml @@ -28,15 +28,16 @@ jobs: mv -fv shared_files/encrypted/* shared_files/decrypted/ - name: Start DB - run: make start-db + run: make reset-db - - name: Generate docs - run: docker run --rm -v $PWD:/work -w /work --network bcda-app-net ghcr.io/k1low/tbls doc --rm-dist "postgres://postgres:toor@db:5432/bcda?sslmode=disable" dbdocs/bcda - - - name: Generate docs - run: docker run --rm -v $PWD:/work -w /work --network bcda-app-net ghcr.io/k1low/tbls doc "postgres://postgres:toor@queue:5432/bcda_queue?sslmode=disable" dbdocs/bcda_queue + - name: Generate DB docs + run: make dbdocs - uses: EndBug/add-and-commit@v9 with: message: "Generate dbdocs" default_author: github_actions + + - name: Cleanup secrets + if: always() + run: rm -r shared_files/decrypted diff --git a/Makefile b/Makefile index ce75887c9..6c735614b 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,7 @@ test: $(MAKE) postman env=local maintenanceMode="" $(MAKE) smoke-test env=local maintenanceMode="" -start-db: +reset-db: # Rebuild the databases to ensure that we're starting in a fresh state docker compose -f docker-compose.yml rm -fsv db queue @@ -106,7 +106,7 @@ start-db: docker run --rm -v ${PWD}/db/migrations:/migrations --network bcda-app-net migrate/migrate -path=/migrations/bcda/ -database 'postgres://postgres:toor@db:5432/bcda?sslmode=disable&x-migrations-table=schema_migrations_bcda' up docker run --rm -v ${PWD}/db/migrations:/migrations --network bcda-app-net migrate/migrate -path=/migrations/bcda_queue/ -database 'postgres://postgres:toor@queue:5432/bcda_queue?sslmode=disable&x-migrations-table=schema_migrations_bcda_queue' up -load-fixtures: start-db +load-fixtures: reset-db docker compose run db psql -v ON_ERROR_STOP=1 "postgres://postgres:toor@db:5432/bcda?sslmode=disable" -f /var/db/fixtures.sql $(MAKE) load-synthetic-cclf-data $(MAKE) load-synthetic-suppression-data @@ -190,7 +190,7 @@ bdt: -e SECRET='${CLIENT_SECRET}' \ bdt -.PHONY: api-shell debug-api debug-worker docker-bootstrap docker-build lint load-fixtures load-fixtures-ssas load-synthetic-cclf-data load-synthetic-suppression-data package performance-test postman release smoke-test test unit-test worker-shell bdt unit-test-db unit-test-db-snapshot +.PHONY: api-shell debug-api debug-worker docker-bootstrap docker-build lint load-fixtures load-fixtures-ssas load-synthetic-cclf-data load-synthetic-suppression-data package performance-test postman release smoke-test test unit-test worker-shell bdt unit-test-db unit-test-db-snapshot reset-db dbdocs documentation: docker compose up --build documentation @@ -202,6 +202,9 @@ credentials: # For example: ACO_CMS_ID=A9993 make credentials @docker compose run --rm api sh -c 'bcda reset-client-credentials --cms-id $(ACO_CMS_ID)'|tail -n2 +dbdocs: + docker run --rm -v $PWD:/work -w /work --network bcda-app-net ghcr.io/k1low/tbls doc --rm-dist "postgres://postgres:toor@db:5432/bcda?sslmode=disable" dbdocs/bcda + docker run --rm -v $PWD:/work -w /work --network bcda-app-net ghcr.io/k1low/tbls doc --force "postgres://postgres:toor@queue:5432/bcda_queue?sslmode=disable" dbdocs/bcda_queue # ==== Lambda ====