-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
.DEFAULT_GOAL := init | ||
|
||
.PHONY += init paths checks test clean | ||
|
||
init: # Do the initial configuration of the project | ||
@test -e .env || cp example.env .env | ||
ifeq ($(shell uname),Darwin) | ||
@sed -i '' 's|^PROJECT_PATH=.*|PROJECT_PATH=$(shell pwd | sed 's/\//\\\//g')|' .env | ||
else | ||
@sed -i 's/^PROJECT_PATH=.*/PROJECT_PATH=$(shell pwd | sed 's/\//\\\//g')/' .env | ||
endif | ||
|
||
.env: init | ||
|
||
paths: .env # Create the necessary data directories | ||
@mkdir -p $(shell grep -E '^WEI_DATA_DIR=' .env | cut -d '=' -f 2) | ||
@mkdir -p $(shell grep -E '^REDIS_DIR=' .env | cut -d '=' -f 2) | ||
|
||
checks: # Runs all the pre-commit checks | ||
@pre-commit install | ||
@pre-commit run --all-files || { echo "Checking fixes\n" ; pre-commit run --all-files; } | ||
|
||
test: init .env paths # Runs all the tests | ||
@docker compose -f wei.compose.yaml --env-file .env up --build -d | ||
@docker compose -f wei.compose.yaml --env-file .env exec fom_module pytest -p no:cacheprovider fom_module | ||
@docker compose -f wei.compose.yaml --env-file .env down | ||
|
||
clean: | ||
@rm .env |