Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kyeah committed Sep 24, 2024
1 parent fcc8daf commit 9fb9812
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/dbdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 ====

Expand Down

0 comments on commit 9fb9812

Please sign in to comment.