forked from terraform-aws-modules/terraform-aws-vpc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
87 lines (72 loc) · 1.58 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
GIT_BRANCH ?= main
GIT_REMOTE ?= origin
RELEASE_TYPE ?= patch
fmt:
@terraform fmt
init: _creds fmt
@terraform init
docs:
terraform-docs md . > terraform.md
.PHONY: grip
grip:
grip -b
release-zero:
@git tag 0.0.0
@git push origin --tags
_quick-push: ;$(call git_push,"WIP")
_setup-versions:
$(eval export CURRENT_VERSION=$(shell git ls-remote --tags $(GIT_REMOTE) | grep -v latest | awk '{ print $$2}'|grep -v 'stable'| sort -r --version-sort | head -n1|sed 's/refs\/tags\///g'))
$(eval export NEXT_VERSION=$(shell semver -c -i $(RELEASE_TYPE) $(CURRENT_VERSION)))
all-versions:
@git ls-remote --tags $(GIT_REMOTE)
current-version: _setup-versions
@echo $(CURRENT_VERSION)
next-version: _setup-versions
@echo $(NEXT_VERSION)
release: _setup-versions fmt docs
$(call git_push,"release: $(NEXT_VERSION)")
@git tag $(NEXT_VERSION)
@git push $(GIT_REMOTE) --tags
define git_push
-git add .
-git commit -m $1
-git push
endef
#AWS_PROFILE := one
#GITHUB_USER ?= marcelocorreia
#GIT_REPO_NAME ?= terraform-aws-vpc
#
#init: _creds fmt
# cd example && terraform init
#
#plan: _creds init
# cd example && terraform plan
#
#apply: _creds fmt
# cd example && terraform apply --auto-approve
#
#destroy: _creds init
# cd example && terraform destroy --auto-approve
#
#state:
# cd example && terraform state list
#
#fmt:
# terraform fmt
#
#_creds:
# $(eval export AWS_PROFILE=$(AWS_PROFILE))
#
#
#SCAFOLD := badwolf
#_readme:
# terraform-docs md . > io.md
# $(SCAFOLD) generate --resource-type readme .
#
#
#open-page:
# open https://github.com/$(GITHUB_USER)/$(GIT_REPO_NAME).git
#
#_grip:
# grip -b
#