-
Notifications
You must be signed in to change notification settings - Fork 24
/
Taskfile.yml
105 lines (94 loc) · 2.5 KB
/
Taskfile.yml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# https://taskfile.dev
version: "3"
tasks:
build:
desc: "Build the provider binary"
deps:
- install-goreleaser
cmds:
- goreleaser build --single-target --skip=validate --clean --snapshot
sources:
- "**/*.go"
- go.mod
- go.sum
generates:
- terraform-provider-vercel
test:
desc: "Run acceptance tests against the provider"
env:
TF_ACC: "true"
cmds:
- go test ./... {{.CLI_ARGS}}
install-tfplugindocs:
desc: "Install the tfplugindocs tool"
cmds:
- go install github.com/hashicorp/terraform-plugin-docs/cmd/[email protected]
status:
- which tfplugindocs
install-goreleaser:
desc: "Install goreleaser"
cmds:
- go install github.com/goreleaser/goreleaser/v2@latest
status:
- which goreleaser
docs:
desc: "Update the docs generated from description fields"
deps:
- install-tfplugindocs
cmds:
- tfplugindocs
- sed -i.bak 's/vercel Provider/Vercel Provider/g' docs/index.md
- rm docs/index.md.bak
sources:
- "vercel/**/*.go"
- "main.go"
- "examples/**/*.tf"
- "examples/**/*.sh"
generates:
- docs/**/*.md
install-staticcheck:
desc: "Install the staticheck tool"
cmds:
- go install honnef.co/go/tools/cmd/[email protected]
status:
- which staticcheck
install-providerlint:
desc: "Install tfproviderlint tool"
cmds:
- go install github.com/bflad/tfproviderlint/cmd/tfproviderlint@latest
status:
- which tfproviderlint
lint:
desc: "Run linters against the provider"
deps:
- install-staticcheck
- install-providerlint
cmds:
- staticcheck -tags it ./...
- tfproviderlint -R018=false ./...
- cmd: |
export BADFMT=$(gofmt -s -l .)
test -z "$BADFMT" || (echo -e "invalid gofmt: $BADFMT"; exit 1)
silent: true
- go vet ./...
install:
desc: "Set up an override allowing a local version of the provider to be used"
cmds:
- cmd: |-
cat << EOF > ~/.terraformrc
provider_installation {
dev_overrides {
"vercel/vercel" = "$(pwd)/dist/terraform-provider-vercel_{{ OS }}_{{ ARCH }}"
}
direct {}
}
EOF
uninstall:
desc: "Remove any local overrides for local development"
cmds:
- rm ~/.terraformrc
sweep:
desc: "Remove any leftover resources from failed test runs"
dir: "sweep"
cmds:
- go run .