Skip to content

Commit

Permalink
Merge pull request #63 from uktrade/feature/cleanup-makefile-and-readme
Browse files Browse the repository at this point in the history
chore:introduce local setup command and update cache target
  • Loading branch information
hareshkainthdbt authored Dec 2, 2024
2 parents 69053b0 + 1edd045 commit 370021f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,17 @@ isort: # Run isort
secrets-baseline: # Generate a new secrets baseline file
poetry run detect-secrets scan > .secrets.baseline

rebuild_cache_man:
rebuild_cache:
export PYTHONPATH=./fbr && \
export DJANGO_SETTINGS_MODULE='fbr.config.settings.local' && \
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/fbr && \
poetry install && \
poetry run rebuild-cache

setup_local: # Set up the local environment
@echo "$(COLOUR_GREEN)Running initial setup for local environment...$(COLOUR_NONE)"
$(MAKE) first-use
$(MAKE) start
$(MAKE) migrate
$(MAKE) rebuild_cache
@echo "$(COLOUR_GREEN)Local setup complete.$(COLOUR_NONE)"
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ With your Poetry shell active:
> Code quality checks are also performed when pushing your code to origin
> but pre-commit hooks catch issues early and will improve Developer Experience.
### Update database tables
### Setup the service, database and cache locally

$ make setup_local


### Update database tables (manually)...do not use unless you know what you are doing

> To update local database tables, you need to set the `DATABASE_URL` environment variable. You can set it in the terminal or in the `.env` file.
Expand Down

0 comments on commit 370021f

Please sign in to comment.