forked from Janrupf/terraform-provider-influxdb-v2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yaml
76 lines (71 loc) · 1.73 KB
/
Taskfile.yaml
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
# https://taskfile.dev
version: '3'
vars:
BINARY_FOLDER: bin
NAME: influxdb-v2
GOLANGCI_LINT_VERSION: v1.49.0
VERSION: v0.4.4
NAMESPACE: janrupf
dotenv: ['.env']
tasks:
init:
desc: Initialize for development
cmds:
- go install
- go mod tidy
- go mod vendor
build:
desc: Build the provider binary
cmds:
- go build -v -o {{.BINARY_FOLDER}}/terraform-provider-{{.NAME}}_{{.VERSION}}
sources:
- "**/*.go"
- go.mod
- go.sum
generates:
- ' go build -v -o {{.BINARY_FOLDER}}/terraform-provider-{{.NAME}}_{{.VERSION}}'
test:
desc: Run unit tests
cmds:
- go test -tags=unit -v -cover ./...
docs:
desc: Update the generated documentation
cmds:
- go generate
sources:
- "main.go"
- "influxdbv2/**/*.go"
- "examples/**/*.tf"
- go.mod
- go.sum
generates:
- docs/**/*.md
lint:
desc: Run linters
deps:
- install-golangci-lint
cmds:
- golangci-lint run ./influxdbv2/...
sources:
- "influxdbv2\\**\\*.go"
- go.mod
- go.sum
- .golangci.yml
install-golangci-lint:
desc: Install the golangci-lint tool
cmds:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@{{.GOLANGCI_LINT_VERSION}}
status:
- which golangci-lint
- golangci-lint version | grep {{.GOLANGCI_LINT_VERSION}}
start-influx:
desc: Start InfluxDB
cmds:
- ./scripts/setup_influxdb.sh
status:
- while ! $(curl -sS 'http://localhost:8086/ready' | grep -q ready); do echo 'Waiting for influx...'; sleep 1; done
stop-influx:
desc: Stop InfluxDB
cmds:
- docker stop tf_acc_tests_influxdb
- docker rm tf_acc_tests_influxdb