This commit is contained in:
2023-11-26 11:54:04 -06:00
parent d23e3ed9cd
commit 74ee55599f
2 changed files with 11 additions and 3 deletions

View File

@@ -6,9 +6,12 @@ provider "octopusdeploy" {
resource "octopusdeploy_tenant" "tenant" { resource "octopusdeploy_tenant" "tenant" {
name = var.GITLAB_PROJECT_NAME name = var.GITLAB_PROJECT_NAME
project_environment { project_environment {
environments = [ environments = var.Development ? [
"Environments-1",
"Environments-2"
] : [
"Environments-1" "Environments-1"
] ]
project_id = "Projects-1" project_id = "Projects-1"
} }
tenant_tags = [ tenant_tags = [
@@ -26,7 +29,7 @@ resource "octopusdeploy_tenant_common_variable" "gitlabprojectname" {
library_variable_set_id = "LibraryVariableSets-2" library_variable_set_id = "LibraryVariableSets-2"
template_id = "f14ad0ff-d8cf-44a8-bd8d-ff23b0fdb0f4" template_id = "f14ad0ff-d8cf-44a8-bd8d-ff23b0fdb0f4"
tenant_id = octopusdeploy_tenant.tenant.id tenant_id = octopusdeploy_tenant.tenant.id
value = var.GITLAB_PROJECT_NAME value = octopusdeploy_tenant.tenant.name
} }
resource "octopusdeploy_tenant_common_variable" "gitlabrunnerid" { resource "octopusdeploy_tenant_common_variable" "gitlabrunnerid" {

View File

@@ -19,3 +19,8 @@ variable "OCTOAPI" {
variable "OCTO_TENANT_ID" { variable "OCTO_TENANT_ID" {
type = string type = string
} }
variable "Development" {
type = bool
default = false
}