From d7dc7b87b32aa25fafcb6fad052ee5fedb855a61 Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Tue, 3 Sep 2024 23:36:04 -0400 Subject: [PATCH] fix: add github bot options --- main.tf | 2 ++ modules/helm_release/main.tf | 11 ++++++++++- modules/helm_release/variables.tf | 14 +++++++++++++- variables.tf | 14 +++++++++++++- 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 13be245..f940b2a 100644 --- a/main.tf +++ b/main.tf @@ -91,6 +91,8 @@ module "helm_release" { google_auth = var.google_auth + github_bot = var.github_bot + redis_host = module.redis.redis_host redis_port = module.redis.redis_port redis_password = module.redis.redis_auth_string diff --git a/modules/helm_release/main.tf b/modules/helm_release/main.tf index 89998fd..56c326e 100644 --- a/modules/helm_release/main.tf +++ b/modules/helm_release/main.tf @@ -19,6 +19,14 @@ locals { "global.postgresql.database" = var.postgres_database, } + integrations_settings = var.github_bot != null ? { + "global.integrations.github.bot.name" = var.github_bot.name + "global.integrations.github.bot.appId" = var.github_bot.app_id + "global.integrations.github.bot.clientId" = var.github_bot.client_id + "global.integrations.github.bot.clientSecret" = var.github_bot.client_secret + "global.integrations.github.bot.privateKey" = var.github_bot.client_private_key + } : {} + auth_providers_settings = { "global.authProviders.google.clientId" = var.google_auth.client_id, "global.authProviders.google.clientSecret" = var.google_auth.client_secret, @@ -62,7 +70,8 @@ resource "helm_release" "this" { local.postgres_settings, local.redis_settings, local.ingress_annotations, - local.service_account_annotations + local.service_account_annotations, + local.integrations_settings, ) content { name = set.key diff --git a/modules/helm_release/variables.tf b/modules/helm_release/variables.tf index d56cf1b..406768b 100644 --- a/modules/helm_release/variables.tf +++ b/modules/helm_release/variables.tf @@ -66,4 +66,16 @@ variable "chart_version" { variable "fqdn" { type = string default = "" -} \ No newline at end of file +} + +variable "github_bot" { + type = object({ + name = string + app_id = string + client_id = string + client_secret = string + client_private_key = string + }) + description = "The GitHub bot user and token." + default = null +} diff --git a/variables.tf b/variables.tf index a579c26..1f5f741 100644 --- a/variables.tf +++ b/variables.tf @@ -59,5 +59,17 @@ variable "google_auth" { variable "chart_version" { type = string - default = "0.1.20" + default = "0.1.23" +} + +variable "github_bot" { + type = object({ + name = string + app_id = string + client_id = string + client_secret = string + client_private_key = string + }) + description = "The GitHub bot user and token." + default = null }