Add pull-mirror support and a mirrors organisation
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

Expose the non-secret gitea_repository mirror/migration attributes through
the repository module and add the mirrors org for public upstream mirrors.
This commit is contained in:
2026-09-19 15:47:32 +10:00
parent 26e7723251
commit 66823a939a
5 changed files with 78 additions and 0 deletions
@@ -18,6 +18,16 @@ resource "gitea_repository" "this" {
autodetect_manual_merge = var.autodetect_manual_merge
archive_on_destroy = true
mirror = var.mirror
migration_clone_address = var.migration_clone_address
migration_service = var.migration_service
migration_mirror_interval = var.migration_mirror_interval
migration_lfs = var.migration_lfs
migration_lfs_endpoint = var.migration_lfs_endpoint
migration_issue_labels = var.migration_issue_labels
migration_milestones = var.migration_milestones
migration_releases = var.migration_releases
lifecycle {
# migration_mirror_interval defaults to "8h0m0s" but Gitea returns an empty MirrorInterval for non-mirror repos, so the read-back never matches and plans a spurious update every run; it is a migration-only knob with no drift to track here.
ignore_changes = [migration_mirror_interval]
@@ -80,3 +80,48 @@ variable "autodetect_manual_merge" {
type = bool
default = null
}
variable "mirror" {
type = bool
default = null
}
variable "migration_clone_address" {
type = string
default = null
}
variable "migration_service" {
type = string
default = null
}
variable "migration_mirror_interval" {
type = string
default = null
}
variable "migration_lfs" {
type = bool
default = null
}
variable "migration_lfs_endpoint" {
type = string
default = null
}
variable "migration_issue_labels" {
type = bool
default = null
}
variable "migration_milestones" {
type = bool
default = null
}
variable "migration_releases" {
type = bool
default = null
}