initial commit

This commit is contained in:
admin
2023-11-23 13:11:19 -06:00
committed by Octopus Deploy
parent c1d2bb7de2
commit 048c69938a
4 changed files with 124 additions and 0 deletions

View File

@@ -0,0 +1,101 @@
step "plan-to-apply-a-terraform-template" {
name = "Terraform Plan"
action "terraform-plan" {
action_type = "Octopus.TerraformPlan"
environments = ["development"]
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.AdditionalInitParams = "#{TF_INIT}"
Octopus.Action.Terraform.AllowPluginDownloads = "True"
Octopus.Action.Terraform.AzureAccount = "False"
Octopus.Action.Terraform.EnvVariables = "{\"TF_VAR_GITLAB_PROJECT_ID\":\"#{GITLAB_PROJECT_ID}\",\"TF_VAR_GITLAB_PROJECT_NAME\":\"#{GITLAB_PROJECT_NAME}\",\"TF_VAR_GITLAB_SHARED_RUNNER_ID\":\"#{GITLAB_SHARED_RUNNER_ID}\",\"TF_VAR_GITLAB_TOKEN\":\"#{GITLAB_TOKEN}\",\"TF_VAR_OCTOAPI\":\"#{OCTOAPI}\"}"
Octopus.Action.Terraform.GoogleCloudAccount = "False"
Octopus.Action.Terraform.ManagedAccount = "None"
Octopus.Action.Terraform.PlanJsonOutput = "False"
Octopus.Action.Terraform.RunAutomaticFileSubstitution = "True"
OctopusUseBundledTooling = "False"
}
worker_pool_variable = ""
container {
feed = "nexus"
image = "#{TF_Container}"
}
packages {
acquisition_location = "Server"
feed = "nexus-nuget"
package_id = "#{TF_PACKAGE}"
properties = {
SelectionMode = "immediate"
}
}
}
}
step "approve-plan" {
name = "Approve Plan"
action {
action_type = "Octopus.Manual"
environments = ["development"]
is_required = true
properties = {
Octopus.Action.Manual.BlockConcurrentDeployments = "False"
Octopus.Action.Manual.Instructions = <<-EOT
```
#{Octopus.Action[Terraform Plan].Output.TerraformPlanOutput}
```
EOT
}
}
}
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.AdditionalInitParams = "#{TF_INIT}"
Octopus.Action.Terraform.AllowPluginDownloads = "True"
Octopus.Action.Terraform.AzureAccount = "False"
Octopus.Action.Terraform.EnvVariables = "{\"TF_VAR_GITLAB_PROJECT_ID\":\"#{GITLAB_PROJECT_ID}\",\"TF_VAR_GITLAB_PROJECT_NAME\":\"#{GITLAB_PROJECT_NAME}\",\"TF_VAR_GITLAB_SHARED_RUNNER_ID\":\"#{GITLAB_SHARED_RUNNER_ID}\",\"TF_VAR_GITLAB_TOKEN\":\"#{GITLAB_TOKEN}\",\"TF_VAR_OCTOAPI\":\"#{OCTOAPI}\"}"
Octopus.Action.Terraform.GoogleCloudAccount = "False"
Octopus.Action.Terraform.ManagedAccount = "None"
Octopus.Action.Terraform.PlanJsonOutput = "False"
Octopus.Action.Terraform.RunAutomaticFileSubstitution = "True"
OctopusUseBundledTooling = "False"
}
worker_pool_variable = ""
container {
feed = "nexus"
image = "#{TF_Container}"
}
packages {
acquisition_location = "Server"
feed = "nexus-nuget"
package_id = "#{TF_PACKAGE}"
properties = {
SelectionMode = "immediate"
}
}
}
}

View File

@@ -0,0 +1,7 @@
connectivity_policy {
allow_deployments_to_no_targets = true
}
versioning_strategy {
template = "#{Octopus.Version.LastMajor}.#{Octopus.Version.LastMinor}.#{Octopus.Version.NextPatch}"
}

View File

@@ -0,0 +1 @@
version = 6

15
.octopus/variables.ocl Normal file
View File

@@ -0,0 +1,15 @@
variable "GITLAB_SHARED_RUNNER_ID" {
value "18379541" {}
}
variable "TF_CONTAINER" {
value "developerdurp/octopus-packages" {}
}
variable "TF_INIT" {
value "-backend-config=\"address=https://gitlab.com/api/v4/projects/#{GITLAB_PROJECT_ID}/terraform/state/gitlab\" -backend-config=\"lock_address=https://gitlab.com/api/v4/projects/#{GITLAB_PROJECT_ID}/terraform/state/gitlab/lock\" -backend-config=\"unlock_address=https://gitlab.com/api/v4/projects/#{GITLAB_PROJECT_ID}/terraform/state/gitlab/lock\" -backend-config=\"username=developerdurp\" -backend-config=\"password=#{GITLAB_TOKEN}\" -backend-config=\"lock_method=POST\" -backend-config=\"unlock_method=DELETE\" -backend-config=\"retry_wait_min=5\"" {}
}
variable "TF_PACKAGE" {
value "TERRAFORM.GITLAB.PROJECTS" {}
}