10 Commits

Author SHA1 Message Date
Octopus Deploy
6ff48c3a35 Update step template version 2023-12-19 21:12:28 -06:00
43371eaf10 update 2023-12-19 20:51:08 -06:00
f3ffff7d94 [skip ci] 2023-12-19 20:49:45 -06:00
554066cd4b update 2023-12-19 20:43:45 -06:00
dc049508b9 update 2023-12-19 08:19:22 -06:00
b3f21b6113 update 2023-12-19 08:14:11 -06:00
9c52840bc5 Update deployment process 2023-12-17 08:12:08 -06:00
Octopus Deploy
1f17866b90 Update step template version 2023-12-17 08:11:20 -06:00
Octopus Deploy
3f9116f88f Update step template version 2023-12-17 08:09:20 -06:00
39a61204f9 [skip cip] 2023-12-17 08:06:53 -06:00
6 changed files with 25 additions and 77 deletions

View File

@@ -2,27 +2,11 @@ step "plan-to-apply-a-terraform-template" {
name = "Terraform Plan"
action "terraform-plan" {
action_type = "Octopus.TerraformPlan"
is_required = true
properties = {
Octopus.Action.GoogleCloud.ImpersonateServiceAccount = "False"
Octopus.Action.GoogleCloud.UseVMServiceAccount = "True"
Octopus.Action.Package.DownloadOnTentacle = "False"
Octopus.Action.Package.FeedId = "nexus-nuget"
Octopus.Action.Package.PackageId = "#{TF_PACKAGE}"
Octopus.Action.RunOnServer = "true"
Octopus.Action.Script.ScriptSource = "Package"
Octopus.Action.Terraform.AdditionalActionParams = "-var-file=./variables.tfvars"
Octopus.Action.Terraform.AdditionalInitParams = "#{TF_INIT}"
Octopus.Action.Terraform.AllowPluginDownloads = "True"
Octopus.Action.Terraform.AzureAccount = "False"
Octopus.Action.Terraform.EnvVariables = "{}"
Octopus.Action.Terraform.FileSubstitution = "variables.tfvars"
Octopus.Action.Terraform.GoogleCloudAccount = "False"
Octopus.Action.Terraform.ManagedAccount = "None"
Octopus.Action.Terraform.PlanJsonOutput = "False"
Octopus.Action.Terraform.RunAutomaticFileSubstitution = "False"
OctopusUseBundledTooling = "False"
Octopus.Action.Template.Id = "ActionTemplates-1"
Octopus.Action.Template.Version = "3"
}
worker_pool_variable = ""
@@ -30,15 +14,6 @@ step "plan-to-apply-a-terraform-template" {
feed = "nexus"
image = "#{TF_Container}"
}
packages {
acquisition_location = "Server"
feed = "nexus-nuget"
package_id = "#{TF_PACKAGE}"
properties = {
SelectionMode = "immediate"
}
}
}
}
@@ -46,16 +21,11 @@ step "approve-plan" {
name = "Approve Plan"
action {
action_type = "Octopus.Manual"
is_required = true
properties = {
Octopus.Action.Manual.BlockConcurrentDeployments = "False"
Octopus.Action.Manual.Instructions = <<-EOT
```
#{Octopus.Action[Terraform Plan].Output.TerraformPlanOutput}
```
EOT
Octopus.Action.RunOnServer = "false"
Octopus.Action.Template.Id = "ActionTemplates-3"
Octopus.Action.Template.Version = "0"
}
}
}
@@ -64,26 +34,10 @@ step "terraform-apply" {
name = "Terraform Apply"
action {
action_type = "Octopus.TerraformApply"
properties = {
Octopus.Action.GoogleCloud.ImpersonateServiceAccount = "False"
Octopus.Action.GoogleCloud.UseVMServiceAccount = "True"
Octopus.Action.Package.DownloadOnTentacle = "False"
Octopus.Action.Package.FeedId = "nexus-nuget"
Octopus.Action.Package.PackageId = "#{TF_PACKAGE}"
Octopus.Action.RunOnServer = "true"
Octopus.Action.Script.ScriptSource = "Package"
Octopus.Action.Terraform.AdditionalActionParams = "-var-file=./variables.tfvars"
Octopus.Action.Terraform.AdditionalInitParams = "#{TF_INIT}"
Octopus.Action.Terraform.AllowPluginDownloads = "True"
Octopus.Action.Terraform.AzureAccount = "False"
Octopus.Action.Terraform.EnvVariables = "{}"
Octopus.Action.Terraform.FileSubstitution = "variables.tfvars"
Octopus.Action.Terraform.GoogleCloudAccount = "False"
Octopus.Action.Terraform.ManagedAccount = "None"
Octopus.Action.Terraform.PlanJsonOutput = "False"
Octopus.Action.Terraform.RunAutomaticFileSubstitution = "False"
OctopusUseBundledTooling = "False"
Octopus.Action.Template.Id = "ActionTemplates-2"
Octopus.Action.Template.Version = "1"
}
worker_pool_variable = ""
@@ -91,14 +45,5 @@ step "terraform-apply" {
feed = "nexus"
image = "#{TF_Container}"
}
packages {
acquisition_location = "Server"
feed = "nexus-nuget"
package_id = "#{TF_PACKAGE}"
properties = {
SelectionMode = "immediate"
}
}
}
}

View File

@@ -1,3 +1,5 @@
default_guided_failure_mode = "On"
connectivity_policy {
allow_deployments_to_no_targets = true
}

View File

@@ -32,14 +32,15 @@ resource "gitlab_branch_protection" "release" {
resource "gitlab_project_runner_enablement" "k3s" {
project = gitlab_project.project.id
runner_id = octopusdeploy_tenant_common_variable.gitlabrunnerid.value
runner_id = var.GITLAB_SHARED_RUNNER_ID
}
#resource "gitlab_project_variable" "OCTOAPI" {
# count = var.OCTOAPI != "" ? 1 : 0
# project = gitlab_project.project.id
# key = "OCTOAPI"
# value = var.OCTOAPI
# protected = false
# masked = true
#}
resource "gitlab_project_variable" "OCTOAPI" {
count = var.Enable_OCTOAPI ? 1 : 0
project = gitlab_project.project.id
key = "OCTOAPI"
value = var.OCTOAPI
protected = false
masked = true
}

View File

@@ -32,9 +32,3 @@ resource "octopusdeploy_tenant_common_variable" "gitlabprojectname" {
value = octopusdeploy_tenant.tenant.name
}
resource "octopusdeploy_tenant_common_variable" "gitlabrunnerid" {
library_variable_set_id = "LibraryVariableSets-2"
template_id = "25732879-3567-4d0b-9aad-2769befabf42"
tenant_id = octopusdeploy_tenant.tenant.id
value = var.GITLAB_SHARED_RUNNER_ID
}

View File

@@ -11,6 +11,11 @@ variable "GITLAB_SHARED_RUNNER_ID" {
default = 0
}
variable "Enable_OCTOAPI" {
type = bool
default = false
}
variable "OCTOAPI" {
type = string
default = ""

View File

@@ -2,5 +2,6 @@ GITLAB_TOKEN="#{GITLAB_TOKEN}"
GITLAB_PROJECT_NAME="#{GITLAB_PROJECT_NAME}"
GITLAB_SHARED_RUNNER_ID="#{GITLAB_SHARED_RUNNER_ID}"
OCTOAPI="#{OCTOAPI}"
Enable_OCTOAPI="#{Enable_OCTOAPI}"
OCTO_TENANT_ID="#{OCTO_TENANT_ID}"
Development="#{Development}"
Development="#{Development}"