forked from CodeForPoznan/codeforpoznan.pl_v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (48 loc) · 1.94 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.DEFAULT_GOAL:=help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
start: ## Start the environment in the background
docker-compose up -d
logs: ## Display logs from containers
docker-compose logs --tail 100 -f
stop: ## Stop the environment
docker-compose stop
bash: ## Go to the backend container
docker-compose exec backend bash
psql: ## Go to the db and make SQL queries
docker-compose exec db psql -U cfp_v3
populate_database: ## Populate database with fake data
docker-compose exec backend flask populate-database
rebuild: ## Rebuild docker images
docker-compose rm --force
docker-compose build --no-cache
test: ## Run unittests
docker-compose exec backend pytest
black: ## Run black
docker-compose exec backend black .
black-check: ## Check black
docker-compose exec backend black --check .
prettier: ## Run prettier
docker-compose exec frontend yarn lint:fix
prettier-check: ## Check prettier
docker-compose exec frontend yarn lint
lint: black prettier
lint-check: black-check prettier-check
code-cov: ## Run pytest with code coverage
docker-compose exec backend pytest --cov=backend
cov-report: ## Generate coverage raport in HTML
docker-compose exec backend pytest --cov=backend --cov-report=html
remove-tokens: ## Remove expired tokens from db
docker-compose exec backend flask remove-expired-tokens
import-attendance-list: ## Import attendance list
docker-compose exec backend flask import-attendance-list
clean-pyc: ## remove .pyc files
find . -type f -name '*.pyc' ! -path "./site-packages/*" -delete
clean: stop clean-pyc ## remove containers and .pyc files
docker-compose rm --force
# AWS Lambda
pack-backend:
7z a ../lambda.zip ./.venv/lib/python*/site-packages/*
7z a ../lambda.zip -xr'!.venv' migrations ../backend
pack-frontend:
yarn run build --dest ../public