-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
71 lines (53 loc) · 1.77 KB
/
GNUmakefile
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
export SHELL:=/bin/bash
export SHELLOPTS:=$(if $(SHELLOPTS),$(SHELLOPTS):)pipefail:errexit
include .env
.ONESHELL:
default: testacc
.PHONY: help
help: ## Prints help for targets with comments
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: install-githooks
install-githooks: ## Install git hooks
git config --local core.hooksPath .githooks
.PHONY: build
build: ## Build the provider
go build
.PHONY: deploy-locally
deploy-locally: ## Install the provider locally in ~/.terraform.d/plugins. Optional set VERSION arg to use specific verion, otherwise 0.0.1 will be used
"$(CURDIR)/scripts/deploy_locally.sh" $(VERSION)
.PHONY: generate
generate: ## Run go generate
go generate ./...
.PHONY: go-fmt
go-fmt: ## Run go fmt
go fmt ./...
tools:
go install github.com/golangci/golangci-lint/cmd/[email protected]
.PHONY: go-lint
go-lint: tools ## Run Golang linters
@echo "==> Run Golang CLI linter..."
@golangci-lint run
setup_test_env:
"$(CURDIR)/scripts/setup_test_env.sh"
.PHONY: pull_test_assets
pull_test_assets: ## Pull test docker images
@docker compose -f "$(CURDIR)/docker-compose.yaml" pull
.PHONY: start_test_env
start_test_env: ## Start test environment
"$(CURDIR)/scripts/start_test_env.sh"
"$(CURDIR)/scripts/wait_for_test_env_ready.sh"
$(MAKE) setup_test_env
.PHONY: test
test: ## Run acceptance tests only (no setup or cleanup)
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
# Run acceptance tests
.PHONY: testacc
testacc: start_test_env ## Start test environment, run acceptance tests and clean up
@function tearDown {
$(MAKE) clean
}
@trap tearDown EXIT
$(MAKE) test
.PHONY: clean
clean: ## Clean up test environment
"$(CURDIR)/scripts/stop_test_env.sh"