From f12272db7acad7c6896eaad93b0d2392dad8077a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Fri, 31 May 2024 14:29:29 +0200 Subject: [PATCH] fix --- share/organisation/postconfig.tf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/share/organisation/postconfig.tf b/share/organisation/postconfig.tf index fec228b..82d5fd8 100644 --- a/share/organisation/postconfig.tf +++ b/share/organisation/postconfig.tf @@ -33,12 +33,12 @@ resource "kubectl_manifest" "post_install_job_taiga" { command: ["/bin/bash", "-xc"] args: - >- - API='http://taiga-taiga.${var.namespace}.svc/api/v1' - JSON='-sH "Content-Type: application/json"' - TOKEN=$(curl -X POST $JSON -d '{ "type": "normal", "username": "admin", "password": "'"$DJANGO_SUPERUSER_PASSWORD"'" }' "$API/auth" | jq -r '.auth_token') - BEAR='-H "Authorization: Bearer '"$TOKEN"'"' + API='http://taiga-taiga.${var.namespace}.svc/api/v1'; + JSON='-sH "Content-Type: application/json"'; + TOKEN=$(curl -X POST $JSON -d '{ "type": "normal", "username": "admin", "password": "'"$DJANGO_SUPERUSER_PASSWORD"'" }' "$API/auth" | jq -r '.auth_token'); + BEAR='-H "Authorization: Bearer '"$TOKEN"'"'; if ! curl $JSON $BEAR "$API/projects"|jq -r '.[].name' |grep -E '^${trimprefix(var.instance,"org-")}$'; then - curl -X POST $JSON $BEAR "http://taiga-taiga.${var.namespace}.svc/api/v1/projects" -d '{ "creation_template": 1, "description": "Organisation ${trimprefix(var.instance,"org-")} project", "is_backlog_activated": true, "is_issues_activated": true, "is_kanban_activated": true, "is_private": true, "is_wiki_activated": true, "name": "${trimprefix(var.instance,"org-")}", }' + curl -X POST $JSON $BEAR "http://taiga-taiga.${var.namespace}.svc/api/v1/projects" -d '{ "creation_template": 1, "description": "Organisation ${trimprefix(var.instance,"org-")} project", "is_backlog_activated": true, "is_issues_activated": true, "is_kanban_activated": true, "is_private": true, "is_wiki_activated": true, "name": "${trimprefix(var.instance,"org-")}", }'; fi env: - name: garbage