-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (42 loc) · 1.44 KB
/
Makefile
File metadata and controls
56 lines (42 loc) · 1.44 KB
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
PROJECT_DIR := `dirname $(abspath $(MAKEFILE_LIST))`
STATIC_DIR := $(PROJECT_DIR)/path_finding/static
ANSIBLE_DIR := $(PROJECT_DIR)/ansible
TERRAFORM_DIR := $(PROJECT_DIR)/terraform
HEADLESS := $(if $(CI), --headless, )
install:
python3 -m pip install -U pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
cd $(STATIC_DIR) && yarn install
build:
cd $(STATIC_DIR) && yarn build
build-github-pages: build
cd $(PROJECT_DIR) && \
python3 manage.py collectstatic -i package.json -i yarn.lock -i node_modules -i src -i tests --no-input && \
cp path_finding/templates/index.html ./index.html
test-js:
cd $(STATIC_DIR)/tests && yarn test
test-py:
cd $(PROJECT_DIR) && pytest -m unit
test-unit: test-js test-py
test-ft:
cd $(PROJECT_DIR) && pytest $(HEADLESS) functional_tests
test: test-unit test-ft
test-ft-staging:
cd $(PROJECT_DIR) && STAGING_SERVER=$(STAGING_DOMAIN) pytest $(HEADLESS) functional_tests
provision-resources:
cd $(TERRAFORM_DIR) && \
terraform init && \
terraform apply -auto-approve
clean-resources:
cd $(TERRAFORM_DIR) && \
terraform destroy -auto-approve
provision-software:
cd $(ANSIBLE_DIR) && \
ansible-playbook -i inventory.ansible provision.yml
deploy-staging:
cd $(ANSIBLE_DIR) && \
ansible-playbook -i inventory.ansible deploy.yml --limit staging --extra-vars "$(ARGS)"
deploy-prod:
cd $(ANSIBLE_DIR) && \
ansible-playbook -i inventory.ansible deploy.yml --limit prod --extra-vars version=master