Skip to content

Commit

Permalink
chore!: separate review apps and scm integrations settiings
Browse files Browse the repository at this point in the history
  • Loading branch information
josephpage committed May 15, 2023
1 parent 9d69a6e commit 0291e83
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 23 deletions.
5 changes: 5 additions & 0 deletions app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ resource "scalingo_app" "app" {

stack_id = data.scalingo_stack.stack.id
force_https = !var.authorize_unsecure_http

# router_logs and sticky_sessions are not yet supported by the provider, but will be in the future
# see https://github.com/Scalingo/terraform-provider-scalingo/issues/158 for tracking progress
# sticky_sessions = var.sticky_sessions
# router_logs = var.router_logs
}

resource "scalingo_container_type" "containers" {
Expand Down
17 changes: 9 additions & 8 deletions scm_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ resource "scalingo_scm_repo_link" "scm_repo_link" {
: data.scalingo_scm_integration.scm_integration[each.key].id
)

auto_deploy_enabled = each.value.auto_deploy_enabled
branch = each.value.branch
delete_on_close_enabled = each.value.delete_on_close_enabled
delete_stale_enabled = each.value.delete_stale_enabled
deploy_review_apps_enabled = each.value.deploy_review_apps_enabled
hours_before_delete_on_close = each.value.hours_before_delete_on_close
hours_before_delete_stale = each.value.hours_before_delete_stale
auto_deploy_enabled = each.value.auto_deploy_enabled
branch = each.value.branch

deploy_review_apps_enabled = var.review_apps.enabled
delete_on_close_enabled = var.review_apps.delete_on_close_enabled
hours_before_delete_on_close = var.review_apps.hours_before_delete_on_close
delete_stale_enabled = var.review_apps.delete_stale_enabled
hours_before_delete_stale = var.review_apps.hours_before_delete_stale
# will be available in v2.1.0 :
# automatic_creation_from_forks_allowed = each.value.automatic_creation_from_forks_allowed
# automatic_creation_from_forks_allowed = var.review_apps.automatic_creation_from_forks_allowed
}
49 changes: 34 additions & 15 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,48 @@ variable "authorize_unsecure_http" {
nullable = false
}

# router_logs and sticky_sessions are not yet supported by the provider, but will be in the future
# see https://github.com/Scalingo/terraform-provider-scalingo/issues/158 for tracking progress
# variable "router_logs" {
# description = "When true, the router logs are included in the application logs."
# type = bool
# default = false
# nullable = false
# }

# variable "sticky_sessions" {
# description = "When true, sticky sessions are enabled."
# type = bool
# default = false
# nullable = false
# }

variable "github_integration" {
description = "Configuration of the GitHub integration of the application. Only one of github_integration or gitlab_integration can be set."
type = object({
repo_url = string
integration_uuid = optional(string)
branch = optional(string, "main")
auto_deploy_enabled = optional(bool, true)
deploy_review_apps_enabled = optional(bool, false)
delete_on_close_enabled = optional(bool, true)
delete_stale_enabled = optional(bool, true)
hours_before_delete_on_close = optional(string, "0")
hours_before_delete_stale = optional(string, "72")
automatic_creation_from_forks_allowed = optional(bool, false)
repo_url = string
integration_uuid = optional(string)
branch = optional(string, "main")
auto_deploy_enabled = optional(bool, true)
})
default = null
}

variable "gitlab_integration" {
description = "Configuration of the GitLab integration of the application. Only one of github_integration or gitlab_integration can be set."
type = object({
repo_url = string
integration_uuid = optional(string)
branch = optional(string, "main")
auto_deploy_enabled = optional(bool, true)
})
default = null
}

variable "review_apps" {
description = "Configuration of the review apps of the application."
type = object({
repo_url = string
integration_uuid = optional(string)
branch = optional(string, "main")
auto_deploy_enabled = optional(bool, true)
deploy_review_apps_enabled = optional(bool, false)
enabled = optional(bool, false)
delete_on_close_enabled = optional(bool, true)
delete_stale_enabled = optional(bool, true)
hours_before_delete_on_close = optional(string, "0")
Expand Down

0 comments on commit 0291e83

Please sign in to comment.