fix
This commit is contained in:
38
share/gitea-tekton-org/gitea_hook.tf
Normal file
38
share/gitea-tekton-org/gitea_hook.tf
Normal 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"
|
||||
# }
|
||||
# })
|
||||
# }
|
||||
Reference in New Issue
Block a user