Skip to content

Commit 2901c1f

Browse files
committed
Fix examples and docs.
1 parent 09cf081 commit 2901c1f

File tree

12 files changed

+61
-36
lines changed

12 files changed

+61
-36
lines changed

.terraformrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
provider_installation {
2+
dev_overrides {
3+
"fnaoto/deploygate" = "~/.terraform.d/plugins/darwin_amd64/terraform-provider-deploygate"
4+
}
5+
6+
direct {}
7+
}

Makefile

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,25 @@
1-
TEST?=$$(go list ./... | grep -v 'vendor')
21
NAME=deploygate
32
BINARY=terraform-provider-${NAME}
4-
VERSION=0.1
53
OS_ARCH?=darwin_amd64
6-
EXAMPLES=examples
4+
PROVIDER_DIR=~/.terraform.d/plugins/${OS_ARCH}
75

86
default: install
97

108
build:
11-
go build -o ${BINARY}
12-
13-
release:
14-
GOOS=darwin GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_darwin_amd64
15-
GOOS=darwin GOARCH=arm64 go build -o ./bin/${BINARY}_${VERSION}_darwin_arm64
16-
GOOS=freebsd GOARCH=386 go build -o ./bin/${BINARY}_${VERSION}_freebsd_386
17-
GOOS=freebsd GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_freebsd_amd64
18-
GOOS=freebsd GOARCH=arm go build -o ./bin/${BINARY}_${VERSION}_freebsd_arm
19-
GOOS=linux GOARCH=386 go build -o ./bin/${BINARY}_${VERSION}_linux_386
20-
GOOS=linux GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_linux_amd64
21-
GOOS=linux GOARCH=arm go build -o ./bin/${BINARY}_${VERSION}_linux_arm
22-
GOOS=openbsd GOARCH=386 go build -o ./bin/${BINARY}_${VERSION}_openbsd_386
23-
GOOS=openbsd GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_openbsd_amd64
24-
GOOS=solaris GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_solaris_amd64
25-
GOOS=windows GOARCH=386 go build -o ./bin/${BINARY}_${VERSION}_windows_386
26-
GOOS=windows GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_windows_amd64
9+
go build ${BINARY}
2710

2811
install: build
29-
mkdir -p ~/.terraform.d/plugins/${OS_ARCH}
30-
mv ${BINARY} ~/.terraform.d/plugins/${OS_ARCH}
12+
mkdir -p $(PROVIDER_DIR)
13+
mv ${BINARY} $(PROVIDER_DIR)
14+
cp .terraformrc ~
3115

32-
test:
33-
go test $(TEST) || exit 1
34-
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4
16+
test:
17+
go test -v $(TESTARGS) -cover -timeout=120s -parallel=4 ./...
3518

3619
testacc: install
37-
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m
38-
39-
examples: install
40-
terraform init $(EXAMPLES)
41-
terraform plan $(EXAMPLES)
42-
terraform apply $(EXAMPLES)
43-
terraform destroy $(EXAMPLES)
20+
TF_ACC=1 go test -v $(TESTARGS) -cover -timeout 120m ./...
4421

4522
docs:
4623
go generate ./...
4724

48-
.PHONY: docs examples testacc test install build release
25+
.PHONY: docs examples testacc test install build

examples/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ terraform.tfvars
22
.terraform/
33
*.log
44
*.tfstate
5-
*.backup
5+
*.backup
6+
7+
.terraform.lock.hcl

examples/data-sources/deploygate_enterprise_member/data-source.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
provider "deploygate" {
32
alias = "enterprise"
43
api_key = var.enterprise_api_key
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
terraform {
2+
required_providers {
3+
deploygate = {
4+
source = "fnaoto/deploygate"
5+
}
6+
}
7+
}

examples/data-sources/deploygate_organization_member/data-source.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
provider "deploygate" {
32
alias = "organization"
43
api_key = var.organization_api_key
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
terraform {
2+
required_providers {
3+
deploygate = {
4+
source = "fnaoto/deploygate"
5+
}
6+
}
7+
}

examples/data-sources/deploygate_organization_team_member/data-source.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
provider "deploygate" {
32
alias = "organization"
43
api_key = var.organization_api_key
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
terraform {
2+
required_providers {
3+
deploygate = {
4+
source = "fnaoto/deploygate"
5+
}
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
terraform {
2+
required_providers {
3+
deploygate = {
4+
source = "fnaoto/deploygate"
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)