-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
72 lines (59 loc) · 1.8 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
64
65
66
67
68
69
70
71
72
.DEFAULT_GOAL := help
# Job parameter: src directory.
CURRENT_DIR := $(shell pwd)
.PHONY: help build test push format lint install.dependencies version.get version.set version.bump
#help: @ List available tasks on this project
help:
@grep -E '[a-zA-Z\.\-]+:.*?@ .*$$' $(MAKEFILE_LIST)| tr -d '#' | awk 'BEGIN {FS = ":.*?@ "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
#install.dependencies: @ install dependencies.
install.dependencies:
@exec >&2; \
echo "> Installing dependencies."; \
python3 -m venv venv; \
. venv/bin/activate; \
venv/bin/python3 -m pip -q install --upgrade pip; \
venv/bin/pip -q install bump2version==1.0.1
#build: @ Builds the package.
build:
@exec >&2; \
echo "> Building."; \
echo "NOOP."
#test: @ Tests the package.
test:
@exec >&2; \
echo "> Testing."; \
export AWS_DEFAULT_REGION="eu-west-3"; \
terraform init; \
terraform validate
#test: @ Push the package.
push:
@exec >&2; \
echo "> Pushing."; \
echo "NOOP."
#format: @ Format code
format:
@exec >&2; \
echo "> Formatting."; \
terraform fmt; \
make -C lambda_function format
#lint: @ Lint package
lint:
@exec >&2; \
echo "> Linting."; \
terraform fmt -check; \
make -C lambda_function lint
#version.get: @ Gets the version value.
version.get: install.dependencies
@venv/bin/bump2version --allow-dirty --dry-run --list patch | grep current_version | sed "s|^.*=||"
#version.get-released: @ Gets the released version value.
version.get-released: version.get
#version.set: @ Sets the version value.
version.set: install.dependencies
@exec >&2; \
echo "> Setting version $(VERSION)"; \
venv/bin/bump2version --allow-dirty --new-version $(VERSION) patch
#version.bump: @ Bump the version value.
version.bump: install.dependencies
@exec >&2; \
echo "> Bumping version."; \
venv/bin/bump2version --allow-dirty patch