-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (74 loc) · 3.2 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
88
89
90
91
.PHONY: fmt lint test testacc docker test_s3_groups test_crud_group test_user_import test_group_import test_crud_user test_groups test_envs generate install_dnf
# Careful -> no empty string at the end of line
.EXPORT_ALL_VARIABLES:
GOBIN=/home/bin/
TF_CLI_CONFIG_FILE=/home/.terraformrc
TF_LOG=debug
TF_ACC=1
export PATH := /root/go/bin/:$(PATH)
docker:
docker build -f Dockerfile -t storagegrid_dev:latest .
install_dnf:
dnf install -y golang
go install -v golang.org/x/tools/gopls@latest
go install -v golang.org/x/tools/cmd/goimports@latest
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest
lint: fmt
golangci-lint run internal/provider
build:
go mod tidy; go install .
generate:
cd tools; go generate ./...
fmt:
gofmt -s -w -e internal
gofmt -s -w -e tests/test.go
terraform fmt -write=true -recursive=true tests/terraform
testacc:
go test -v -cover -timeout 120m ./...
test :
rm -rf bin/terraform-provider-storagegrid
go mod tidy; go install .;\
terraform -chdir=tests/terraform/provider_userpass plan -var-file=../variables.tfvars
test_groups :
rm -rf bin/terraform-provider-storagegrid
go mod tidy; go install .;\
terraform -chdir=tests/terraform/data_users_groups init;\
terraform -chdir=tests/terraform/data_users_groups plan
test_s3_groups :
rm -rf bin/terraform-provider-storagegrid
go mod tidy; go install .;\
terraform -chdir=tests/terraform/data_s3 init;\
terraform -chdir=tests/terraform/data_s3 plan;\
terraform -chdir=tests/terraform/data_s3 apply -auto-approve
test_envs :
rm -rf bin/terraform-provider-storagegrid
go mod tidy; go install .;\
terraform -chdir=tests/terraform/provider_envvars plan -var-file=../variables.tfvars
test_crud_group :
rm -rf bin/terraform-provider-storagegrid
# rm -rf tests/terraform/crud_groups/terraform.tfstate
# rm -rf tests/terraform/crud_groups/terraform.tfstate.backup
go mod tidy; go install .;\
terraform -chdir=tests/terraform/crud_groups init;\
terraform -chdir=tests/terraform/crud_groups plan;\
terraform -chdir=tests/terraform/crud_groups apply -auto-approve #;\
#terraform -chdir=tests/terraform/crud_groups destroy -auto-approve
test_group_import :
rm -rf bin/terraform-provider-storagegrid
go mod tidy; go install .;\
terraform -chdir=tests/terraform/crud_groups init;\
terraform -chdir=tests/terraform/crud_groups state rm storagegrid_groups.new-local-group;\
terraform -chdir=tests/terraform/crud_groups import storagegrid_groups.new-local-group a88ed298-06d7-4381-b032-a1d28d3eb1dd
test_crud_user :
rm -rf bin/terraform-provider-storagegrid
go mod tidy; go install .;\
terraform -chdir=tests/terraform/crud_users init;\
terraform -chdir=tests/terraform/crud_users plan;\
terraform -chdir=tests/terraform/crud_users apply -auto-approve #;\
#terraform -chdir=tests/terraform/crud_users destroy -auto-approve
test_user_import :
rm -rf bin/terraform-provider-storagegrid
go mod tidy; go install .;\
terraform -chdir=tests/terraform/crud_users init;\
# terraform -chdir=tests/terraform/crud_users state rm storagegrid_users.new-local-user;\
terraform -chdir=tests/terraform/crud_users import storagegrid_users.new-local-user b0789794-8aab-4308-985b-55ea4987e91b