66 lines
1.8 KiB
Markdown
66 lines
1.8 KiB
Markdown
# terraform-git
|
|
|
|
Manage Gitea resources, teams, repos, and Woodpecker CI via Terraform.
|
|
|
|
## GitHub (IUCLabs)
|
|
|
|
`config/github.com/IUCLabs/` → `environments/github/iuclabs` → `modules/github_org`. GitHub App credentials and `billing_email` come from `kv/service/github/iuclabs/terraform`. Org membership invites are manual.
|
|
|
|
`config.yaml` (optional, every field):
|
|
|
|
```yaml
|
|
name: IUCLabs
|
|
description: ""
|
|
blog: ""
|
|
location: ""
|
|
email: ""
|
|
twitter_username: ""
|
|
company: ""
|
|
default_repository_permission: read # read | none
|
|
members_can_create_repositories: false
|
|
public_runners: false # public repos may use the Default runner group
|
|
```
|
|
|
|
`team/<name>.yaml`:
|
|
|
|
```yaml
|
|
description: "IUCLabs maintainers"
|
|
privacy: closed
|
|
maintainers: [neoloc]
|
|
members: []
|
|
```
|
|
|
|
`repository/<name>.yaml` (every field, with defaults):
|
|
|
|
```yaml
|
|
description: ""
|
|
private: true
|
|
default_branch: main
|
|
maintainers: [] # users or @team: maintain access, seed initial .github/CODEOWNERS
|
|
codeowners: [] # push access
|
|
merge_type: squash # squash | merge | rebase
|
|
delete_branch_on_merge: true
|
|
rulesets: [] # opt-in rulesets from ruleset/; public repos only
|
|
exclude_rulesets: [] # opt out of non-mandatory all_repos rulesets
|
|
```
|
|
|
|
`ruleset/<name>.yaml`:
|
|
|
|
```yaml
|
|
all_repos: false # apply to every public repo; private repos get no all_repos rulesets
|
|
mandatory: false # cannot be excluded
|
|
target: branch # branch | tag
|
|
enforcement: active
|
|
conditions:
|
|
ref_name:
|
|
include: ["refs/heads/release/*"]
|
|
exclude: []
|
|
rules:
|
|
creation: false
|
|
deletion: true
|
|
non_fast_forward: true
|
|
required_status_checks: {contexts: [ci/woodpecker], strict: true} # branch only
|
|
```
|
|
|
|
Shipped rulesets: `branch-protection`, `tag-protection` (all public repos), `ref-names-branch`, `ref-names-tag` (mandatory).
|