forked from aminueza/terraform-provider-minio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
61 lines (54 loc) · 2.04 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
# 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: localhost:9000
MINIO_USER: minio
MINIO_PASSWORD: minio123
MINIO_ENABLE_HTTPS: false
cmds:
- go test -v -cover ./minio
silent: true