39 lines
953 B
HCL
39 lines
953 B
HCL
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"
|
|
# }
|
|
# })
|
|
# }
|