forked from aminueza/terraform-provider-minio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
73 lines (66 loc) · 2.48 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
# https://taskfile.dev
version: '3'
vars:
PLUGIN_VERSION: $(git describe --tags `git rev-list --tags --max-count=1` | sed 's/v//')
OUTPUT_FILENAME: terraform-provider-minio
tasks:
default:
cmds:
- task --list
silent: true
build:
desc: Build the plugin into current folder.
cmds:
- echo "Building {{.OUTPUT_FILENAME}}"
- go build -gcflags "all=-N -l" -o "{{.OUTPUT_FILENAME}}"
- echo "Done!"
silent: true
generate-docs:
desc: Generate the docs for the provider
cmds:
- go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest
install:
desc: Build and install the plugin in the correct folder (resolved automatically based on current Operating System).
vars:
WINDOWS_OUTPUT_PATH: '{{.APPDATA}}\HashiCorp\Terraform\plugins\registry.terraform.io\aminueza\minio\{{.PLUGIN_VERSION}}\{{OS}}_{{ARCH}}\{{.OUTPUT_FILENAME}}'
DARWIN_OUTPUT_PATH: '{{.HOME}}/Library/Application Support/io.terraform/plugins/registry.terraform.io/aminueza/minio/{{.PLUGIN_VERSION}}/{{OS}}_{{ARCH}}/{{.OUTPUT_FILENAME}}'
UNIX_OUTPUT_PATH: '{{.HOME}}/.local/share/terraform/plugins/registry.terraform.io/aminueza/minio/{{.PLUGIN_VERSION}}/{{OS}}_{{ARCH}}/{{.OUTPUT_FILENAME}}'
cmds:
- |
{{if eq OS "windows"}}
echo "Building and installing plugin in {{.WINDOWS_OUTPUT_PATH}}"
go build -o "{{.WINDOWS_OUTPUT_PATH}}"
{{else}}
{{if eq OS "darwin"}}
echo "Building and installing plugin in {{.DARWIN_OUTPUT_PATH}}"
go build -o "{{.DARWIN_OUTPUT_PATH}}"
{{else}}
echo "Building and installing plugin in {{.UNIX_OUTPUT_PATH}}"
go build -o "{{.UNIX_OUTPUT_PATH}}"
{{end}}
{{end}}
echo "Done!"
silent: true
test:
desc: Run the package tests.
env:
TF_ACC: 0
MINIO_ENDPOINT: 172.17.0.1:9000
MINIO_USER: minio
MINIO_PASSWORD: minio123
MINIO_ENABLE_HTTPS: false
SECOND_MINIO_ENDPOINT: 172.17.0.1:9002
SECOND_MINIO_USER: minio
SECOND_MINIO_PASSWORD: minio321
SECOND_MINIO_ENABLE_HTTPS: false
THIRD_MINIO_ENDPOINT: 172.17.0.1:9004
THIRD_MINIO_USER: minio
THIRD_MINIO_PASSWORD: minio456
THIRD_MINIO_ENABLE_HTTPS: false
FOURTH_MINIO_ENDPOINT: 172.17.0.1:9006
FOURTH_MINIO_USER: minio
FOURTH_MINIO_PASSWORD: minio654
FOURTH_MINIO_ENABLE_HTTPS: false
cmds:
- go test -v -cover ./minio
silent: true