This repository has been archived by the owner on Nov 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
59 lines (42 loc) · 1.96 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
#!/usr/bin/env make
.PHONY: all verify install uninstall env validate launch delete status
.PHONY: list-outputs list-resources export-outputs clean help
.DEFAULT_GOAL := help
include ../config.mk
all: install uninstall ## Integration test
verify: env lint validate ## Validate CloudFormation Template(s)
install: env lint validate launch export-outputs status ## Deploy CloudFormation Stack(s)
uninstall: env delete clean ## Terminate CloudFormation Stack(s) and clean up local files
env: # Install local env in a local virtual environment
$(info INFO: make cfn/$@ ...)
pipenv sync
lint: ## Run linters on CloudFormation templates
pipenv run cfn-lint --build-graph --info templates/**/**/*.yaml
pipenv run checkov --directory templates/
validate: # Validate CloudFormation Template(s)
$(info INFO: make cfn/$@ ...)
pipenv run sceptre validate $(SCEPTRE_STACK_NAME)
launch: # Deploy CloudFormation Stack(s)
$(info INFO: make cfn/$@ ...)
pipenv run sceptre launch --yes $(SCEPTRE_STACK_NAME)
delete: # Terminate CloudFormation Stack(s)
$(info INFO: make cfn/$@ ...)
pipenv run sceptre delete --yes $(SCEPTRE_STACK_NAME)
status: env ## Show deployment status of the CloudFormation Stack(s)
$(info INFO: make cfn/$@ ...)
pipenv run sceptre status $(SCEPTRE_STACK_NAME)
list-outputs: # List CloudFormation Outputs of the Stack(s)
pipenv run sceptre list outputs $(SCEPTRE_STACK_NAME)
list-resources: # List CloudFormation Resources of the Stack(s)
$(info INFO: make cfn/$@ ...)
pipenv run sceptre list resources $(SCEPTRE_STACK_NAME)
export-outputs: # Generate export commands for CloudFormation Stack Outputs
# This target is intentionally PHONY
$(info INFO: make cfn/$@ ...)
pipenv run sceptre list outputs $(SCEPTRE_STACK_NAME) --export=envvar > outputs.cfg
clean: # Delete virtual environment
$(info INFO: make cfn/$@ ...)
pipenv --rm || true
help:
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-18s\033[0m %s\n", $$1, $$2}' \
$(MAKEFILE_LIST)