This commit is contained in:
2024-04-19 12:22:23 +02:00
parent 7dae79cb46
commit b56a7de484
41 changed files with 2911 additions and 12 deletions

View File

@@ -0,0 +1,38 @@
locals {
gitea_host = "http://gitea-http.${var.domain}-ci.svc:3000"
gitea_username = data.kubernetes_secret_v1.gitea.data["username"]
gitea_password = data.kubernetes_secret_v1.gitea.data["password"]
request_headers = {
"Content-Type" = "application/json"
Authorization = "Basic ${base64encode("${local.gitea_username}:${local.gitea_password}")}"
}
}
data "kubernetes_secret_v1" "gitea" {
metadata {
name = "gitea-admin-user"
namespace = "${var.domain}-ci"
}
}
provider "restapi" {
uri = "${local.gitea_host}/api/v1"
headers = local.request_headers
id_attribute = "id"
}
# resource "restapi_object" "gitea_org_hook" {
# path = "/orgs/${var.organization}/hooks"
# data = jsonencode({
# type = "gitea"
# active = true
# branch_filter = "*"
# events = [
# "create",
# "push"
# ],
# config = {
# url = ""
# content_type = "application/json"
# }
# })
# }