-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
59 lines (48 loc) · 1.83 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
default: build
build: ## Build the docker containers
docker-compose build
rebuild-db
test
help: ## Output available commands
@echo "Available commands:"
@echo
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
lint-check: ## Conduct lint checks
@docker-compose exec web flake8 .
@echo "flake8 complete!"
@docker-compose exec web black . --check
@echo "black complete!"
@docker-compose exec web /bin/sh -c "isort ./**/*.py --check-only"
@echo "isort complete!"
lint-correct: ## Correct lint issues
@docker-compose exec web flake8 .
@echo "flake8 complete!"
@docker-compose exec web black .
@echo "black complete!"
@docker-compose exec web /bin/sh -c "isort ./**/*.py"
@echo "isort complete!"
lint-diff: ## Display differences in lint
@docker-compose exec web flake8 .
@echo "flake8 complete!"
@docker-compose exec web black . --diff
@echo "black complete!"
@docker-compose exec web /bin/sh -c "isort ./**/*.py --diff"
@echo "isort complete!"
postgres: ## Access db via psql
@echo "# \c web_dev"
@echo "# \dt"
@docker-compose exec users-db psql -U postgres
rebuild: ## Rebuild docker images
@docker-compose up -d --build
rebuild-db: ## Rebuild db in docker image
@docker-compose exec web python app/db.py
start: # Start docker containers
@docker-compose up -d
test: ## Run the current test suite
@docker-compose exec web python -m pytest --cov="."
test-routes: ## Test routes using HTTPie
@echo "Get all: http GET <HOST_URL>/summaries/"
@echo "Get one: http GET <HOST_URL>/summaries/<id>"
@echo "Add Summary: http --json POST <HOST_URL>/summaries/ url=https://shaunb.ca"
@echo "Change Summary: http --json PUT <HOST_URL>/summaries/ url=https://shaunb.ca summary=super"
@echo "Get one: http DELETE <HOST_URL>/summaries/<id>"