mirror of
https://github.com/go-gitea/terraform-provider-gitea.git
synced 2026-07-01 21:03:59 -04:00
1d31451bcc
PR to fix the build again before proposing changes to enable https://gitea.com/gitea/terraform-provider-gitea/issues/111. This is my first time contributing to a Terraform Provider, any thoughts or feedback will be greatly appreciated! No functionality is changed, only the examples, test pipelines and docs, so I did not increment the version of the provider. I am still a bit unsure about the lifecycle management of Terraform Providers. Should it be incremented anyway? Co-authored-by: Boris van der Donck <b.vanderdonck@kadaster.nl> Reviewed-on: https://gitea.com/gitea/terraform-provider-gitea/pulls/112 Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com> Co-authored-by: BravoDeltaBD <bravodeltabd@noreply.gitea.com> Co-committed-by: BravoDeltaBD <bravodeltabd@noreply.gitea.com>
1.9 KiB
1.9 KiB
Contributing to the Gitea Terraform Provider
Thank you for your interest in contributing to the Gitea Terraform Provider! This document outlines the basic process to contribute effectively.
Getting Started
- Fork the repository on Gitea.
- Clone your fork locally.
- Create a branch for your changes.
See also Hashicorp's Terraform Provider tutorial
Testing your changes
Running a local Gitea instance
docker run -p 3000:3000 gitea/gitea:latest-rootless
Visit http://localhost:3000 and go through the setup:
- Url: http://localhost:3000
- Username: gitea_admin
- Password: gitea_admin
- Email: admin@gitea.local
Using the local version of the Provider
This involves 2 main steps:
go install .to install the provider binary.- Use .terraformrc file to point to that binary instead of the terraform registry.
See Terraform docs on development overrides for provider developers
Also see this tutorial section for a bit more context.
Example linux ~/.terraformrc file:
provider_installation {
dev_overrides {
"go-gitea/gitea" = "/home/<username>/go/bin"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
Applying the example module
With the local provider and the local Gitea instance set up properly as per above chapters, the example module can be applied:
- navigate into
examples/ - run terraform commands