From 6b0c4c934993e05725ef36bfbda04398008ffd72 Mon Sep 17 00:00:00 2001 From: apollorion Date: Thu, 6 Jun 2024 11:47:03 -0400 Subject: [PATCH] fix: needs separate if --- config.yml.example | 2 +- spacemk/templates/base.tf.jinja | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config.yml.example b/config.yml.example index df55023..6e628b9 100644 --- a/config.yml.example +++ b/config.yml.example @@ -16,7 +16,7 @@ generator: # # Default: false # github: # custom_app: false -# + # # If you want spacelift to manage your state set to `true`. # # If you want to use a third-party backend, like s3, set to `false`. # # Default: true diff --git a/spacemk/templates/base.tf.jinja b/spacemk/templates/base.tf.jinja index b7a3bdb..1445198 100644 --- a/spacemk/templates/base.tf.jinja +++ b/spacemk/templates/base.tf.jinja @@ -98,10 +98,12 @@ resource "spacelift_stack" "{{ stack._relationships.space._migration_id }}_{{ st {{ argument("runner_image ", extra_vars.custom_terraform_runner_image ~ ":" ~ stack.terraform.version, required=True) }} {% endif %} - {% if stack.vcs.provider == "github_custom" and generation_config.github.custom_app %} + {% if stack.vcs.provider == "github_custom" %} + {% if generation_config.github.custom_app %} github_enterprise { {{ argument("namespace", stack.vcs.namespace) }} } + {% endif %} {% elif stack.vcs.provider %} {{ stack.vcs.provider }} { {{ argument("namespace", stack.vcs.namespace) }} @@ -260,11 +262,13 @@ resource "spacelift_module" "{{ module._relationships.space._migration_id }}_{{ {{ argument("terraform_provider", module.terraform_provider) }} {% block module_arguments_extra scoped %}{% endblock %} - {% if module.vcs.provider == "github_custom" and generation_config.github.custom_app %} + {% if module.vcs.provider == "github_custom" %} + {% if generation_config.github.custom_app %} github_enterprise { {{ argument("namespace", module.vcs.namespace) }} } {% endif %} + {% endif %} } {% block module_extra scoped %}{% endblock %} {% endif %}