Skip to content

Commit

Permalink
Merge pull request #86 from aminueza/use-taskfile-instead-of-make
Browse files Browse the repository at this point in the history
  • Loading branch information
felladrin committed Dec 8, 2020
2 parents 7403545 + 7621e18 commit b8557a4
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 79 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ENV ADMINIO_UI_PATH=/usr/local/share/adminio-ui

# Copy and install pre-built AdminIO-UI
COPY --from=adminio-ui /usr/share/nginx/html ${ADMINIO_UI_PATH}
RUN chmod -R 777 ${ADMINIO_UI_PATH}

# Install Node.js
ARG INSTALL_NODE="true"
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"hashicorp.terraform"
],
"remoteUser": "vscode",
"postStartCommand": "make install_linux & minio server ${MINIO_VOLUMES} & adminio & npx angular-http-server -p ${ADMINIO_UI_PORT} --path ${ADMINIO_UI_PATH} &",
"postStartCommand": "go get github.com/go-task/task/v3/cmd/task && task install && minio server ${MINIO_VOLUMES} & adminio & npx angular-http-server -p ${ADMINIO_UI_PORT} --path ${ADMINIO_UI_PATH} &",
"forwardPorts": [
9000,
8080,
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ jobs:
run: go get -v -t -d ./...
- name: Build the docker-compose stack
run: docker-compose -f test-compose.yml up -d
- name: Test
env:
TF_ACC: 0
MINIO_ENDPOINT: localhost:9000
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
MINIO_ENABLE_HTTPS: false
run: go test -count=1 -v -cover ./...
- name: Install Taskfile
uses: Arduino/actions/setup-taskfile@master
with:
version: '3.x'
- name: Run test task
run: task test
- name: Remove containers
run: docker rm -f minio
13 changes: 11 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ tasks:
name: MinIO Server
- command: adminio
name: AdminIO Server
- command: npx angular-http-server -p ${ADMINIO_UI_PORT} --path ${ADMINIO_UI_PATH}
- command: |
sed -i 's/apiMultiBackend = true/apiMultiBackend = false/' ${ADMINIO_UI_PATH}/env.js &&
sed -i 's/apiBaseUrl = "http:\/\/localhost:8080"/apiBaseUrl = `https:\/\/8080${location.hostname.substr(4)}`/' ${ADMINIO_UI_PATH}/env.js &&
npx angular-http-server -p ${ADMINIO_UI_PORT} --path ${ADMINIO_UI_PATH}
name: AdminIO-UI Server
- init: make install_linux
- init: |
cd $(mktemp -d) &&
go mod init task &&
go get github.com/go-task/task/v3/cmd/task &&
cd - &&
task install
name: Terminal
image:
file: .devcontainer/Dockerfile
42 changes: 0 additions & 42 deletions Makefile

This file was deleted.

28 changes: 6 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,16 @@ It just means that we can't guarantee backward compatibility.

Prebuilt versions of this provider are available for MacOS and Linux on the [releases page](https://github.com/aminueza/terraform-provider-minio/releases/latest).

But if you need to build it yourself, just download this repository and follow the instructions:
But if you need to build it yourself, just download this repository, [install](https://taskfile.dev/#/installation) [Task](https://taskfile.dev/):

### MacOS

To build and install this plugin on MacOS, run:

```
make install_mac
```

### Linux

To build and install this plugin on Linux, run:

```
make install_linux
```sh
go get github.com/go-task/task/v3/cmd/task
```

### Windows
And run the following command to build and install the plugin in the correct folder (resolved automatically based on the current Operating System):

For Windows we don't have a Makefile, but it should be as simple as:

```
go build -o terraform-provider-minio_v1.0.0
mkdir "%APPDATA%\HashiCorp\Terraform\plugins\registry.terraform.io\aminueza\minio\1.0.0\windows_amd64"
move terraform-provider-minio_v1.0.0 %APPDATA%\HashiCorp\Terraform\plugins\registry.terraform.io\aminueza\minio\1.0.0\windows_amd64
```sh
task install
```

## Examples
Expand Down
56 changes: 56 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# https://taskfile.dev

version: '3'

vars:
PLUGIN_VERSION: 1.2.0
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 -o "{{.OUTPUT_FILENAME}}"
- echo "Done!"
silent: true

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_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
MINIO_ENABLE_HTTPS: false
cmds:
- go test -v -cover ./minio
silent: true
2 changes: 1 addition & 1 deletion examples/bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
minio = {
source = "aminueza/minio"
version = "~> 1.0.0"
version = ">= 1.0.0"
}
}
required_version = ">= 0.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
minio = {
source = "aminueza/minio"
version = "~> 1.0.0"
version = ">= 1.0.0"
}
}
required_version = ">= 0.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
minio = {
source = "aminueza/minio"
version = "~> 1.0.0"
version = ">= 1.0.0"
}
}
required_version = ">= 0.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/user/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
minio = {
source = "aminueza/minio"
version = "~> 1.0.0"
version = ">= 1.0.0"
}
}
required_version = ">= 0.13"
Expand Down

0 comments on commit b8557a4

Please sign in to comment.