100 lines
4.1 KiB
Plaintext
100 lines
4.1 KiB
Plaintext
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.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"
|
|
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"
|
|
}
|
|
}
|
|
}
|
|
|
|
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"
|
|
}
|
|
}
|
|
}
|
|
} |