From 48b72be2e5785b7b029a4fc517cf350774c35554 Mon Sep 17 00:00:00 2001 From: Weii Wang Date: Mon, 8 Sep 2025 14:09:45 +0800 Subject: [PATCH] chore(docs): update terraform docs and add terraform-docs workflow --- .github/workflows/terraform-docs.yaml | 15 +++++++++ terraform/charm/README.md | 45 +++++++++++++++++++++++++++ terraform/product/README.md | 45 +++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 .github/workflows/terraform-docs.yaml diff --git a/.github/workflows/terraform-docs.yaml b/.github/workflows/terraform-docs.yaml new file mode 100644 index 0000000000..b94315333a --- /dev/null +++ b/.github/workflows/terraform-docs.yaml @@ -0,0 +1,15 @@ +name: Update Terraform documentation + +on: + pull_request: + push: + branches: + - main + +jobs: + terraform-docs: + name: Update Terraform documentation + uses: canonical/operator-workflows/.github/workflows/generate_terraform_docs.yaml@main + secrets: inherit + with: + terraform-directory: terraform/charm,terraform/product diff --git a/terraform/charm/README.md b/terraform/charm/README.md index 957aa0b018..28f62529a1 100644 --- a/terraform/charm/README.md +++ b/terraform/charm/README.md @@ -57,3 +57,48 @@ The complete list of available integrations can be found [in the Integrations ta [Terraform Juju provider]: https://registry.terraform.io/providers/juju/juju/latest [Juju]: https://juju.is [github-runner-integrations]: https://charmhub.io/github-runner/integrations + + +## Requirements + +| Name | Version | +|------|---------| +| [juju](#requirement\_juju) | >= 0.11.0 | + +## Providers + +| Name | Version | +|------|---------| +| [juju](#provider\_juju) | >= 0.11.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [juju_application.github_runner](https://registry.terraform.io/providers/juju/juju/latest/docs/resources/application) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [app\_name](#input\_app\_name) | Name of the application in the Juju model. | `string` | `"github-runner"` | no | +| [base](#input\_base) | The operating system on which to deploy | `string` | `"ubuntu@22.04"` | no | +| [channel](#input\_channel) | The channel to use when deploying a charm. | `string` | `"latest/stable"` | no | +| [config](#input\_config) | Application config. Details about available options can be found at https://charmhub.io/github-runner/configurations | `map(string)` | `{}` | no | +| [constraints](#input\_constraints) | Juju constraints to apply for this application. | `string` | `""` | no | +| [model](#input\_model) | Reference to a `juju_model`. | `string` | `""` | no | +| [revision](#input\_revision) | Revision number of the charm | `number` | `null` | no | +| [units](#input\_units) | Number of units to deploy | `number` | `1` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [app\_name](#output\_app\_name) | Name of the deployed application. | +| [provides](#output\_provides) | n/a | +| [requires](#output\_requires) | n/a | + \ No newline at end of file diff --git a/terraform/product/README.md b/terraform/product/README.md index 6c0e4c47eb..fb286aad23 100644 --- a/terraform/product/README.md +++ b/terraform/product/README.md @@ -20,3 +20,48 @@ the bundle deployment onto any Kubernetes environment managed by [Juju][Juju]. [Juju]: https://juju.is [Github runner charm]: https://charmhub.io/github-runner [Github runner image builder charm]: https://charmhub.io/github-runner-image-builder + + +## Requirements + +| Name | Version | +|------|---------| +| [juju](#requirement\_juju) | >= 0.11.0 | + +## Providers + +| Name | Version | +|------|---------| +| [juju](#provider\_juju) | >= 0.11.0 | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [github\_runner](#module\_github\_runner) | ../charm | n/a | +| [github\_runner\_image\_builder](#module\_github\_runner\_image\_builder) | git::https://github.com/canonical/github-runner-image-builder-operator//terraform/charm | rev67 | + +## Resources + +| Name | Type | +|------|------| +| [juju_integration.image_builder](https://registry.terraform.io/providers/juju/juju/latest/docs/resources/integration) | resource | +| [juju_model.github_runner](https://registry.terraform.io/providers/juju/juju/latest/docs/data-sources/model) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [github\_runner\_image\_builder](#input\_github\_runner\_image\_builder) | n/a |
object({
app_name = optional(string, "github-runner-image-builder")
channel = optional(string, "latest/stable")
config = optional(map(string), {})
constraints = optional(string, "arch=amd64 cores=2 mem=8192M root-disk=20000M")
revision = optional(number)
base = optional(string, "ubuntu@22.04")
units = optional(number, 1)
})
| n/a | yes | +| [github\_runners](#input\_github\_runners) | n/a |
list(object({
app_name = optional(string, "github-runner")
channel = optional(string, "latest/stable")
config = optional(map(string), {})
constraints = optional(string, "arch=amd64 cores=2 mem=8192M root-disk=20000M")
revision = optional(number)
base = optional(string, "ubuntu@22.04")
units = optional(number, 1)
}))
| n/a | yes | +| [model](#input\_model) | Reference to the Juju model to deploy the github-runner and github-runner-image-builder operators. | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [all\_app\_names](#output\_all\_app\_names) | Names of the all the deployed apps, github-runner plus github-runner-image-builder. | +| [all\_runner\_names](#output\_all\_runner\_names) | Names of the all the deployed github-runner applications. | +| [github\_runner\_image\_builder\_app\_name](#output\_github\_runner\_image\_builder\_app\_name) | Name of the the deployed github-runner-image-builder application. | +| [reactive\_runner\_names](#output\_reactive\_runner\_names) | Names of the all the deployed github-runner applications that are reactive. | + \ No newline at end of file