-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
63 lines (48 loc) · 2.09 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
#!/usr/bin/env make
.PHONY: verify install uninstall dependencies smoketest init deploy status open clean help
.DEFAULT_GOAL := help
MAKEFLAGS=s
include ../Makefile.cfg
include ../cfn/outputs.cfg
all: install uninstall ## Integration test
verify: dependencies smoketest ## Run a smoke test on the local Locust test suite
install: dependencies smoketest init deploy status open ## (Re)deploy the Locust test suite to Elastic Beanstalk
uninstall: clean ## Delete the local virtual environment and temporary files
dependencies: # Install local dependencies in a local virtual environment
$(call cyan, "make eb/$@ ...")
pipenv install
smoketest: # Run a smoke test on the local Locust test suite
$(call cyan, "make eb/$@ ...")
pipenv run locust --no-web --only-summary --locustfile=./locustfile.py \
--clients=100 --hatch-rate=20 --run-time=10s
init: # (Re)initialize the EB CLI to target the Elastic Beanstalk environment
$(call cyan, "make eb/$@ ...")
# (Re)initialize the EB CLI to target the Elastic Beanstalk environment
rm -rf ./.elasticbeanstalk/
pipenv run eb init --region $(AWS_REGION) --platform $(SCEPTRE_ElasticBeanstalkPlatform) \
$(SCEPTRE_PROJECT_CODE)-$(SCEPTRE_STACK_NAME)-cluster
deploy: init # (Re)deploy the Locust application
$(call cyan, "make eb/$@ ...")
pipenv run eb deploy --region $(AWS_REGION) --staged \
$(SCEPTRE_PROJECT_CODE)-$(SCEPTRE_STACK_NAME)-cluster
status: init ## Show deployment status of the Locust application
$(call cyan, "make eb/$@ ...")
pipenv run eb status --region $(AWS_REGION) \
$(SCEPTRE_PROJECT_CODE)-$(SCEPTRE_STACK_NAME)-cluster
open: init # Open the Locust web GUI in a web browser
$(call cyan, "make eb/$@ ...")
pipenv run eb open --region $(AWS_REGION) \
$(SCEPTRE_PROJECT_CODE)-$(SCEPTRE_STACK_NAME)-cluster
clean: # Delete virtual environment and temporary files
$(call cyan, "make eb/$@ ...")
pipenv --rm || true
rm -vrf __pycache__/
rm -vrf .elasticbeanstalk/
help:
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-18s\033[0m %s\n", $$1, $$2}' \
$(MAKEFILE_LIST)
define cyan
@tput setaf 6
@echo $1
@tput sgr0
endef