9ab540719e
Express a fork as an optional fork_from key on the repository yaml, so a forked repo is declared the same way as any other repo. - add fork_from "<owner>/<repo>" to the repository module and object type - create gitea_fork instead of gitea_repository when fork_from is set - validate the source repo name matches the config file name, since a fork inherits the source name - move gitea_repository.this to index 0 for the count refactor - index existing repository import targets to match
113 lines
4.5 KiB
Terraform
113 lines
4.5 KiB
Terraform
variable "organisation" {
|
|
description = "Map of organisations to create"
|
|
type = map(object({
|
|
name = string
|
|
description = optional(string, "")
|
|
full_name = optional(string)
|
|
visibility = optional(string, "public")
|
|
website = optional(string, "")
|
|
location = optional(string, "")
|
|
repo_admin_change_team_access = optional(bool, false)
|
|
}))
|
|
default = {}
|
|
}
|
|
|
|
variable "repository" {
|
|
description = "Map of repositories to create"
|
|
type = map(object({
|
|
name = string
|
|
organisation = string
|
|
fork_from = optional(string)
|
|
description = optional(string)
|
|
private = optional(bool)
|
|
default_branch = optional(string)
|
|
has_issues = optional(bool)
|
|
has_wiki = optional(bool)
|
|
has_pull_requests = optional(bool)
|
|
has_projects = optional(bool)
|
|
allow_merge_commits = optional(bool)
|
|
allow_rebase = optional(bool)
|
|
allow_rebase_explicit = optional(bool)
|
|
allow_squash_merge = optional(bool)
|
|
archived = optional(bool)
|
|
repo_template = optional(bool)
|
|
website = optional(string)
|
|
autodetect_manual_merge = optional(bool)
|
|
|
|
mirror = optional(bool)
|
|
migration_clone_address = optional(string)
|
|
migration_service = optional(string)
|
|
migration_mirror_interval = optional(string)
|
|
migration_lfs = optional(bool)
|
|
migration_lfs_endpoint = optional(string)
|
|
migration_issue_labels = optional(bool)
|
|
migration_milestones = optional(bool)
|
|
migration_releases = optional(bool)
|
|
}))
|
|
default = {}
|
|
}
|
|
|
|
variable "branch_protection" {
|
|
description = "Map of branch protection rules to create"
|
|
type = map(object({
|
|
repository = string
|
|
organisation = string
|
|
rule_name = string
|
|
enable_push = optional(bool, false)
|
|
push_whitelist_users = optional(list(string), [])
|
|
push_whitelist_teams = optional(list(string), [])
|
|
push_whitelist_deploy_keys = optional(bool, false)
|
|
merge_whitelist_users = optional(list(string), [])
|
|
merge_whitelist_teams = optional(list(string), [])
|
|
required_approvals = optional(number, 0)
|
|
approval_whitelist_users = optional(list(string), [])
|
|
approval_whitelist_teams = optional(list(string), [])
|
|
status_check_contexts = optional(list(string), [])
|
|
block_on_rejected_reviews = optional(bool, false)
|
|
block_on_official_review_requests = optional(bool, false)
|
|
block_on_outdated_branch = optional(bool, false)
|
|
dismiss_stale_approvals = optional(bool, false)
|
|
require_signed_commits = optional(bool, false)
|
|
protected_file_patterns = optional(string, "")
|
|
unprotected_file_patterns = optional(string, "")
|
|
}))
|
|
default = {}
|
|
}
|
|
|
|
|
|
variable "user" {
|
|
description = "Map of Gitea user accounts to create"
|
|
type = map(object({
|
|
username = string
|
|
email = string
|
|
login_name = optional(string)
|
|
full_name = optional(string, "")
|
|
description = optional(string, "")
|
|
visibility = optional(string, "limited")
|
|
admin = optional(bool, false)
|
|
restricted = optional(bool, false)
|
|
active = optional(bool, true)
|
|
allow_create_organization = optional(bool, false)
|
|
max_repo_creation = optional(number, 0)
|
|
must_change_password = optional(bool, false)
|
|
vault_seed_path = optional(string)
|
|
vault_seed_mount = optional(string, "kv")
|
|
}))
|
|
default = {}
|
|
}
|
|
|
|
variable "team" {
|
|
description = "Map of teams to create"
|
|
type = map(object({
|
|
name = string
|
|
organisation = string
|
|
description = optional(string, "")
|
|
permission = optional(string, "read")
|
|
include_all_repositories = optional(bool, false)
|
|
can_create_repos = optional(bool, false)
|
|
repositories = optional(list(string), [])
|
|
members = optional(list(string), [])
|
|
}))
|
|
default = {}
|
|
}
|