262 lines
6.5 KiB
HCL
262 lines
6.5 KiB
HCL
variable "name" {
|
||
type = string
|
||
description = "Repository Name"
|
||
}
|
||
|
||
variable "forked_from_project_id" {
|
||
type = number
|
||
description = "Forked from"
|
||
default = 0
|
||
}
|
||
|
||
variable "description" {
|
||
type = string
|
||
description = "Repository Description"
|
||
}
|
||
|
||
variable "parent_group" {
|
||
type = string
|
||
description = "Parent Group"
|
||
}
|
||
|
||
variable "default_branch" {
|
||
type = string
|
||
description = "Default branch"
|
||
default = "master"
|
||
}
|
||
|
||
variable "ci_config_path" {
|
||
type = string
|
||
description = "CI PATH"
|
||
default = null
|
||
}
|
||
|
||
variable "tags" {
|
||
type = list(string)
|
||
description = "Tags"
|
||
default = []
|
||
}
|
||
|
||
variable "build_git_strategy" {
|
||
type = string
|
||
default = "clone"
|
||
description = "The Git strategy. Defaults to fetch."
|
||
}
|
||
|
||
variable "archived" {
|
||
type = bool
|
||
default = false
|
||
description = "Archived project"
|
||
}
|
||
|
||
variable "allowed_project_types_json" {
|
||
type = string
|
||
default = ""
|
||
description = "Path to allowed project types json"
|
||
}
|
||
|
||
variable "project_type" {
|
||
type = string
|
||
description = "Project type"
|
||
default = ""
|
||
|
||
validation {
|
||
condition = contains(keys(local.allowed_project_types), var.project_type)
|
||
error_message = "Unsupported project project_type"
|
||
}
|
||
}
|
||
|
||
variable "allowed_avatar_types_json" {
|
||
type = string
|
||
default = ""
|
||
description = "Path to allowed avatar types json"
|
||
}
|
||
|
||
variable "avatar" {
|
||
type = string
|
||
description = "Type of the avatar for the group (default: from type)"
|
||
default = ""
|
||
|
||
validation {
|
||
condition = contains(local.allowed_avatar_types, var.avatar)
|
||
error_message = "Unsupported group type"
|
||
}
|
||
}
|
||
|
||
|
||
variable "is_enable_conventional_commits_push_rule" {
|
||
type = bool
|
||
default = false
|
||
description = "Enable conventional commits push rule"
|
||
}
|
||
|
||
variable "protected_branches" {
|
||
type = map(object({
|
||
push_access_level = string
|
||
merge_access_level = string
|
||
}))
|
||
description = "Protected branches"
|
||
default = {
|
||
"master" = {
|
||
push_access_level = "maintainer"
|
||
merge_access_level = "developer"
|
||
}
|
||
}
|
||
}
|
||
|
||
variable "protected_tags" {
|
||
type = map(object({
|
||
create_access_level = string
|
||
}))
|
||
description = "Protected tags"
|
||
default = {
|
||
"v*" = {
|
||
create_access_level = "maintainer"
|
||
}
|
||
}
|
||
}
|
||
|
||
variable "is_enabled_checkmarx" {
|
||
type = bool
|
||
default = true
|
||
description = "Enable checkmarx"
|
||
}
|
||
|
||
variable "is_enabled_sonarqube" {
|
||
type = bool
|
||
default = true
|
||
description = "Enable sonarqube"
|
||
}
|
||
|
||
|
||
variable "sib_aplikacja" {
|
||
type = string
|
||
description = "[UPW] ID Aplikacja w zasobach SIB"
|
||
default = ""
|
||
}
|
||
|
||
variable "ci_variables" {
|
||
type = map(object({
|
||
value = string
|
||
description = optional(string)
|
||
protected = optional(bool)
|
||
masked = optional(bool)
|
||
environment_scope = optional(string)
|
||
}))
|
||
description = "CI variables to be set for the group"
|
||
default = null
|
||
}
|
||
|
||
variable "scoped_variables" {
|
||
description = <<-EOT
|
||
{
|
||
"VARIABLE_NAME" = {
|
||
description = "opis"
|
||
protected = optional(bool, false)
|
||
masked = optional(bool, false)
|
||
values = {
|
||
"environment_name" = "value"
|
||
"environment_2" = "value2"
|
||
}
|
||
}
|
||
}
|
||
EOT
|
||
type = map(object({
|
||
description = optional(string, "")
|
||
protected = optional(bool, false)
|
||
masked = optional(bool, false)
|
||
values = map(string)
|
||
}))
|
||
default = {}
|
||
}
|
||
|
||
variable "environments" {
|
||
type = map(string)
|
||
description = "Project environments"
|
||
default = {}
|
||
}
|
||
|
||
variable "attributes" {
|
||
type = map(string)
|
||
default = {}
|
||
description = "custom attributes to be set for the project"
|
||
}
|
||
|
||
variable "only_allow_merge_if_pipeline_succeeds" {
|
||
description = "Set to true if you want allow merges only if a pipeline succeeds."
|
||
type = bool
|
||
default = false
|
||
}
|
||
|
||
variable "allow_merge_on_skipped_pipeline" {
|
||
description = "Set to true if you want to treat skipped pipelines as if they finished with success."
|
||
type = bool
|
||
default = true
|
||
}
|
||
|
||
variable "group_runners_enabled" {
|
||
description = "Enable group runners for this project."
|
||
type = bool
|
||
default = true
|
||
}
|
||
|
||
variable "shared_runners_enabled" {
|
||
description = "Enable shared runners for this project."
|
||
type = bool
|
||
default = true
|
||
}
|
||
|
||
variable "build_timeout" {
|
||
description = "The maximum amount of time, in seconds, that a job can run."
|
||
type = number
|
||
default = 3600
|
||
}
|
||
|
||
variable "auto_cancel_pending_pipelines" {
|
||
description = "Auto-cancel pending pipelines. This isn’t a boolean, but enabled/disabled."
|
||
type = string
|
||
default = "enabled"
|
||
}
|
||
|
||
variable "token_scope_groups" {
|
||
description = "CI_JOB_TOKEN group allowlist"
|
||
type = list(string)
|
||
default = []
|
||
}
|
||
|
||
variable "token_scope_repositories" {
|
||
description = "CI_JOB_TOKEN repositories allowlist"
|
||
type = list(string)
|
||
default = []
|
||
}
|
||
|
||
# Zbiór reguł approvals (project-level)
|
||
variable "approvals" {
|
||
description = "Mapa reguł approval dla projektu. Klucz = nazwa reguły."
|
||
type = map(object({
|
||
approvals_required = number
|
||
users = optional(list(number), [])
|
||
groups = optional(list(number), [])
|
||
applies_to_all_protected_branches = optional(bool, true)
|
||
protected_branch_ids = optional(list(number), null)
|
||
rule_type = optional(string, "regular") # np. regular | any_approver
|
||
report_type = optional(string, null) # np. coverage | scan_finding | license_scanning
|
||
disable_importing_default_any_approver_rule_on_create = optional(bool, false)
|
||
}))
|
||
default = {}
|
||
}
|
||
|
||
# Ustawienia zachowania approvals (MR-level settings)
|
||
variable "approval_settings" {
|
||
description = "Ustawienia zasad approvals na poziomie merge requestów."
|
||
type = object({
|
||
disable_overriding_approvers_per_merge_request = optional(bool, true)
|
||
merge_requests_author_approval = optional(bool, false)
|
||
merge_requests_disable_committers_approval = optional(bool, true)
|
||
reset_approvals_on_push = optional(bool, true)
|
||
required_password_to_approve = optional(bool, false)
|
||
selective_code_owner_removals = optional(bool, false)
|
||
})
|
||
default = {}
|
||
}
|