fix(blog): add missing description and made a few edits
All checks were successful
/ all (push) Successful in 38s

This commit is contained in:
Julien Dessaux 2025-06-11 13:53:24 +02:00
parent 263bc80328
commit 8354360aaf
Signed by: adyxax
GPG key ID: F92E51B86E07177E

View file

@ -1,6 +1,6 @@
---
title: Writing an OpenTofu/terraform provider for Forgejo
description:
title: Writing an OpenTofu/Terraform provider for Forgejo
description: My second open source provider
date: 2025-05-28
tags:
- Forgejo
@ -10,36 +10,35 @@ tags:
## Introduction
Last month I started writing an OpenTofu/terraform provider for
[Forgejo](https://forgejo.org/). I wanted to automate this forge the same as I
automate github already: create and manage repositories, provision actions
Last month I started writing an OpenTofu/Terraform provider for
[Forgejo](https://forgejo.org/). I wanted to automate this forge in the same way
I already automate GitHub: create and manage repositories, provision actions
secrets and variables, configure issue labels, manage mirrors, etc.
A community provider already existed but it is really barebones and missing
almost all the resources I need. I could have tried to contribute to it, but
after looking at the code I decided not to bother.
after looking at the code I decided to start from scratch.
I wrote providers before so could get right to it.
I wrote providers before so I could get right to it.
## Writing a terraform provider
## Writing a Terraform provider
My notes from [writing a terraform provider for eventline]({{< ref
"eventline.md" >}}) still apply. With a few previous experiences, this is really
straightforward work.
My notes from [writing a Terraform provider for eventline]({{< ref
"eventline.md" >}}) still apply. With a few previous experiences writing
providers, this has become straightforward work.
The difficulty and frustration only came from the Forgejo's API which is pretty
inconsistent to say it nicely. A community SDK forked from Gitea exists but I
admit that I did not like its code much either and decided to write my own small
API client.
The only significant difficulties and frustrations arose from the Forgejo API
which is pretty inconsistent to say it nicely. A community SDK forked from Gitea
exists but after looking at its code I decided to write my own small API client.
## Conclusion
Writing a terraform provider is still a lot of fun, I recommend it! If you have
a piece of software that you wish had a terraform provider, know that it is not
hard to make it a reality. It is also a great learning project, being bounded in
scope and immediately useful.
Writing a Terraform provider is a lot of fun, I recommend it! If you have a
piece of software that you wish had a Terraform provider, know that it is not
hard to make it a reality. It is also a great learning project, being
well-bounded in scope and immediately useful.
Here is [the repository of my forgejo
Here is [the repository of my Forgejo
provider](https://git.adyxax.org/adyxax/terraform-provider-forgejo/) for
reference and here is [the
documentation](https://registry.terraform.io/providers/adyxax/forgejo/latest/docs).