From a63c809c478358e6c60bdfec2c60913ed8de05af Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 13:41:18 -0800 Subject: [PATCH] terraform/provider: build and test in-tree Drop the standalone repo's release and git-hook instructions, credit the original author, and list the provider in the terraform layout. Co-Authored-By: Claude Opus 5.5 --- terraform/README.md | 3 +++ terraform/provider/Makefile | 6 +----- terraform/provider/README.md | 23 +++++++++++++---------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/terraform/README.md b/terraform/README.md index 053278f4a6..b50cc5ac50 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -33,6 +33,9 @@ terraform/ aws-ha-distributed/ 3 masters + 3 volumes (1/AZ) + 2 filers + 1 S3, secure-by-default (mTLS via SSM-delivered certs) aws-all-in-one/ single `weed server` instance via core directly + provider/ Terraform provider (Go) that manages S3 buckets and their + configuration, IAM and S3 Tables through a running cluster's + S3 and IAM APIs; see provider/README.md. test/ local/ render a cluster with core and run it as real weed processes on 127.0.0.1 (no cloud, no docker), then assert it works diff --git a/terraform/provider/Makefile b/terraform/provider/Makefile index d71bccdf50..d0555309e5 100644 --- a/terraform/provider/Makefile +++ b/terraform/provider/Makefile @@ -1,6 +1,6 @@ SHELL := /bin/bash -.PHONY: fmt test test-race build docs check lint vuln hooks +.PHONY: fmt test test-race build docs check lint vuln fmt: go fmt ./... @@ -25,7 +25,3 @@ lint: vuln: govulncheck ./... - -hooks: - git config core.hooksPath .githooks - pre-commit install --install-hooks --hook-dir .githooks diff --git a/terraform/provider/README.md b/terraform/provider/README.md index 7b3fabb26e..de0da9e374 100644 --- a/terraform/provider/README.md +++ b/terraform/provider/README.md @@ -4,6 +4,10 @@ Terraform and OpenTofu provider for SeaweedFS S3, IAM, and S3 Tables APIs. The provider targets SeaweedFS 4.51 API behavior and supports importing every managed resource; each resource's documentation lists its import identifier. +Originally written by Luís Costa as +[terraform-provider-seaweedfs](https://github.com/luiscosta18/terraform-provider-seaweedfs) +and licensed under the MIT license in [LICENSE](LICENSE). + ## Managed resources - **S3 buckets:** bucket lifecycle and tags, CORS, lifecycle rules, versioning, @@ -45,7 +49,7 @@ and configuration you intend to use before relying on IAM resources. ## Build ```bash -go mod tidy +cd terraform/provider go build -o terraform-provider-seaweedfs ``` @@ -99,16 +103,15 @@ resource "seaweedfs_iam_user" "example" { `true`/`false` and defaults to `false`. Explicit provider configuration takes precedence over environment variables. -## CI and Release +## Tests -- CI: `.github/workflows/ci.yml` — runs on every push and pull request. -- Release: `.github/workflows/release.yml` — runs on every push to `main`. - Parses conventional commits since the last tag and creates a new `vMAJOR.MINOR.PATCH` - tag and GitHub release automatically. No manual tagging required. - `GITHUB_TOKEN` is provided automatically by GitHub Actions; no additional secrets are needed. -- GoReleaser config: `.goreleaser.yml` -- Install pre-commit and Conventional Commit hooks with `make hooks` - (requires the `pre-commit` CLI). +```sh +make test-race +make lint +``` + +The `terraform: validate and test modules` workflow builds, vets and +unit-tests this module on every change under `terraform/`. ## Local SeaweedFS integration smoke test