-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (23 loc) · 1012 Bytes
/
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
help: ## Display help for this makefile
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
clean:
rm -f .venv
setup_tests: ## Install poetry and then dependencies under its virtual environment
@pip install poetry
@poetry install
.PHONY: setup_tests
run_tests: ## Run tests
@poetry run pytest .
.PHONY: run_tests
activate_virtual_env: ## Activate poetry's virtual env
@poetry shell
.PHONY: activate_virtual_env
setup_invoke: ## Install serverless to call lambdas locally
@npm install -g serverless || echo "check https://www.serverless.com/framework/docs/getting-started"
.PHONY: setup_invoke
invoke_add_new_book: ## Run lambda locally
@echo 'Add lambda input params. Example: {"attributes":{"author":"Some Name","title":"Some Title"},"file_path":"/home/michael/something"}'; \
read PARAMS; \
serverless invoke local --function add_new_book --data="$${PARAMS}" --raw
.PHONY: invoke_add_new_book