Files
BravoDeltaBD 1d31451bcc Update examples and test pipeline to fix build. Add additional documentation. Update terraform docs. (#112)
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>
2025-05-16 14:40:46 +00:00

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

  1. Fork the repository on Gitea.
  2. Clone your fork locally.
  3. 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:

  1. Url: http://localhost:3000
  2. Username: gitea_admin
  3. Password: gitea_admin
  4. 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