Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
[Issue #191] Cleanup makefile commands around OpenSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
chouinar committed Sep 6, 2024
1 parent 2b23dd4 commit 9c0d01a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,22 @@ setup-local:
build:
docker compose build

start:
start: ## Start the API
docker compose up --detach

start-debug:
docker compose -f docker-compose.yml -f docker-compose.debug.yml up --detach

run-logs: start
run-logs: start ## Start the API and follow the logs
docker compose logs --follow --no-color $(APP_NAME)

init: build init-db init-opensearch init-localstack

clean-volumes: ## Remove project docker volumes (which includes the DB state)
clean-volumes: ## Remove project docker volumes - which includes the DB, and OpenSearch state
docker compose down --volumes

volume-recreate: clean-volumes init ## Destroy current volumes, setup new ones - will remove all existing data

stop:
docker compose down

Expand All @@ -126,9 +128,6 @@ start-db:
docker compose up --detach grants-db
./bin/wait-for-local-db.sh

## Destroy current DB, setup new one
db-recreate: clean-volumes init-db

#########################
# DB Migrations
#########################
Expand Down Expand Up @@ -166,7 +165,7 @@ db-migrate-history: ## Show migration history
db-migrate-heads: ## Show migrations marked as a head
$(alembic_cmd) heads $(args)

db-seed-local:
db-seed-local: ## Generate records into your local database
$(PY_RUN_CMD) db-seed-local $(args)

db-check-migrations: ## Verify the DB schema matches the DB migrations generated
Expand All @@ -183,8 +182,7 @@ setup-postgres-db: ## Does any initial setup necessary for our local database to
# Opensearch
##################################################

init-opensearch: start-opensearch
# TODO - in subsequent PRs, we'll add more to this command to setup the search index locally
init-opensearch: start-opensearch ## Start the opensearch service locally

start-opensearch:
docker compose up --detach opensearch-node
Expand Down Expand Up @@ -275,6 +273,9 @@ setup-foreign-tables:
seed-local-legacy-tables:
$(PY_RUN_CMD) python3 -m tests.lib.seed_local_legacy_tables

populate-search-opportunities: ## Load opportunities from the DB into the search index, run "make db-seed-local" first to populate your database
$(FLASK_CMD) load-search-data load-opportunity-data $(args)

##################################################
# Miscellaneous Utilities
##################################################
Expand Down
2 changes: 1 addition & 1 deletion documentation/api/database/database-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This command is not needed when starting the application with `make start`
To clean the database, use the following command:

```sh
make db-recreate
make volume-recreate
```

This will remove _all_ docker project volumes, rebuild the database volume, and
Expand Down

0 comments on commit 9c0d01a

Please sign in to comment.