-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (48 loc) · 1.56 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
.PHONY: help
help:
@echo 'make <target>'
@echo ''
@echo 'Targets:'
@echo ''
@echo ' help Show this help'
@echo ' pre-commit Run pre-commit checks'
@echo ''
@echo ' gcp_clean Clean up state files'
@echo ' gcp_configure Configure the deployment'
@echo ' gcp_deploy Deploy configured resources'
@echo ' gcp_init Initialize modules, providers'
@echo ' gcp_install Install Terraform'
@echo ' gcp_lint Run linters'
@echo ' gcp_plan Show deployment plan'
@echo ' gcp_test Run tests'
@echo ''
.PHONY: pre-commit
pre-commit:
@pre-commit run -a
.PHONY: gcp_clean
gcp_clean:
@cd gcp/project && rm -rf .terraform *.tfstate* .terraform.lock.hcl
@cd gcp/project/test && rm -f go.mod go.sum
.PHONY: gcp_configure
gcp_configure:
@cd gcp && ./scripts/configure.sh -e example -m US -o kpeder -p us-east1 -s us-central1 -t devops
.PHONY: gcp_deploy
gcp_deploy: gcp_configure gcp_init
@cd gcp/project/test && go test -v
.PHONY: gcp_init
gcp_init: gcp_configure
@cd gcp/project && terraform init
@cd gcp/project/test && go mod init project_test.go; go mod tidy
.PHONY: gcp_install
gcp_install:
@chmod +x ./scripts/install_terraform.sh
@sudo ./scripts/install_terraform.sh -v ./gcp/versions.yaml
.PHONY: gcp_lint
gcp_lint: gcp_configure gcp_init
@cd gcp/project/test && golangci-lint run --print-linter-name --verbose project_test.go
.PHONY: gcp_plan
gcp_plan: gcp_configure gcp_init
@cd gcp/project && terraform plan
.PHONY: gcp_test
gcp_test: gcp_configure gcp_init
@cd gcp/project/test && go test -v -destroy