From 18bd380e3b8e94a75fe972c110be134450360393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Mon, 22 Apr 2024 13:25:20 +0200 Subject: [PATCH] fix --- .../gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml | 1 + share/organisation/ci-space.tf | 4 ++-- share/organisation/gitea-user.tf | 3 ++- share/organisation/stages.tf | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml b/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml index 82f4be3..b3a6320 100644 --- a/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml +++ b/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml @@ -78,6 +78,7 @@ spec: name: gitea-set-status tasks: - name: inform-gitea-start + onError: continue params: - name: REPO_FULL_NAME value: $(params.project-path) diff --git a/share/organisation/ci-space.tf b/share/organisation/ci-space.tf index cfcd661..67aa63a 100644 --- a/share/organisation/ci-space.tf +++ b/share/organisation/ci-space.tf @@ -80,9 +80,9 @@ resource "kubernetes_secret" "ci-docker-config" { auths = { "${data.kubernetes_ingress_v1.gitea.spec[0].rule[0].host}" = { "username" = gitea_user.user-ci[0].username - "password" = random_password.password.result + "password" = local.ci-user-password "email" = "auto-ci@${data.kubernetes_ingress_v1.gitea.spec[0].rule[0].host}" - "auth" = base64encode("${gitea_user.user-ci[0].username}:${random_password.password.result}") + "auth" = base64encode("${gitea_user.user-ci[0].username}:${local.ci-user-password}") } } }) diff --git a/share/organisation/gitea-user.tf b/share/organisation/gitea-user.tf index 4480206..84659dd 100644 --- a/share/organisation/gitea-user.tf +++ b/share/organisation/gitea-user.tf @@ -4,6 +4,7 @@ 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"] + ci-user-password = random_password.password.result } data "kubernetes_secret_v1" "gitea" { @@ -83,7 +84,7 @@ resource "gitea_user" "user-ci" { count = local.needKnownHost?1:0 username = "${var.instance}-ci" login_name = "${var.instance}-ci" - password = random_password.password.result + password = local.ci-user-password email = "${var.instance}-ci@${var.domain_name}" must_change_password = true } diff --git a/share/organisation/stages.tf b/share/organisation/stages.tf index 0f79758..fe0055d 100644 --- a/share/organisation/stages.tf +++ b/share/organisation/stages.tf @@ -55,9 +55,9 @@ resource "kubernetes_secret" "docker-config" { auths = { "${data.kubernetes_ingress_v1.gitea.spec[0].rule[0].host}" = { "username" = gitea_user.user-ci[0].username - "password" = random_password.password.result + "password" = local.ci-user-password "email" = "auto-ci@${data.kubernetes_ingress_v1.gitea.spec[0].rule[0].host}" - "auth" = base64encode("${gitea_user.user-ci[0].username}:${random_password.password.result}") + "auth" = base64encode("${gitea_user.user-ci[0].username}:${local.ci-user-password}") } } })