Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add contributing docs #1229

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ by Terraform Plugin Provider to perform CRUD on resources.
the SDK. The commands can either come from dynamic loaded OpenAPI spec or static
modules, i.e: authentication.

* **[terraform-provider-mgc](./mgc/terraform-provider-mgc/)**: Terraform Plugin Provider,
with the same commands and actions defined by the SDK. The provider enables
managing resources on Magalu Cloud.

Most of our code is written in Golang, however there are some utility scripts written
in Python as well.

Expand All @@ -46,7 +50,7 @@ For this, [Poetry](https://python-poetry.org/) is used. Check [Poetry.md](Poetry

## Running the CLI

See [cli/RUNNING.md](./mgc/cli/RUNNING.md)
See [cli/DEVELOPMENT.md](./mgc/cli/DEVELOPMENT.md)

## OpenAPI

Expand Down
26 changes: 26 additions & 0 deletions mgc/terraform-provider-mgc/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Magalu Cloud Provider

The MGC provider allows you to use Terraform to manage your resources on Magalu Cloud.

# Development build

## Dependencies and build

```shell
go mod tidy
make build
```

## Using local provider

```terraform
terraform {
required_providers {
mgc = {
source = "terraform.local/local/mgc"
version = "1.0.0"
}
}
}
```

6 changes: 6 additions & 0 deletions mgc/terraform-provider-mgc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,10 @@ setup-config: ## Setup configuration file for Terraform or OpenTofu
@echo "File $$config_file written to $$HOME:"
@cat $$config_file

build: ## Build the plugin
Copy link
Member

@luizcavalcanti luizcavalcanti Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
We can be more specific here and call it build-tf or something similar.

Also we can leverage goreleaser, with some goreleaser build --snapshot --clean --single-target --config=goreleaser_internal.yaml, which builds it according to plan and uses proper version number (algo is user-platform-specific)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review and suggestions! About the goreleaser, i didn't know about it, thank you for the tip.
As it is installed locally, what you think would be the best way to integrated with the script? Document as a pre-requisite or use the bash script?

@echo "Building the plugin..."
@mkdir -p ~/.terraform.d/plugins/terraform.local/local/mgc/1.0.0/linux_amd64/
@go build -o ~/.terraform.d/plugins/terraform.local/local/mgc/1.0.0/linux_amd64/terraform-provider-mgc_v1.0.0
@echo "Plugin built successfully."

all: update-subcategory check-example-usage check-empty-subcategory generate-docs setup-config ## Run all tasks
2 changes: 1 addition & 1 deletion mgc/terraform-provider-mgc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The provider is currently under development, so new Magalu Cloud resources will

# Participate
- You can contribute to an [open issue](https://github.com/MagaluCloud/terraform-provider-mgc/issues) to report a bug or suggest improvements and new features
- You can open tópic in our [Dicussions Forum](https://github.com/MagaluCloud/terraform-provider-mgc/discussions)
- You can open topic in our [Dicussions Forum](https://github.com/MagaluCloud/terraform-provider-mgc/discussions)
- See our roadmap in [projects](https://github.com/orgs/MagaluCloud/projects/2/views/7)


Expand Down