From 048c69938a3ac306ae84a3ae51883c6d1086c739 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 23 Nov 2023 13:11:19 -0600 Subject: [PATCH] initial commit --- .octopus/deployment_process.ocl | 101 +++++++++++++++++++++++++++++++ .octopus/deployment_settings.ocl | 7 +++ .octopus/schema_version.ocl | 1 + .octopus/variables.ocl | 15 +++++ 4 files changed, 124 insertions(+) create mode 100644 .octopus/deployment_process.ocl create mode 100644 .octopus/deployment_settings.ocl create mode 100644 .octopus/schema_version.ocl create mode 100644 .octopus/variables.ocl diff --git a/.octopus/deployment_process.ocl b/.octopus/deployment_process.ocl new file mode 100644 index 0000000..a01dcf9 --- /dev/null +++ b/.octopus/deployment_process.ocl @@ -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" + } + } + } +} \ No newline at end of file diff --git a/.octopus/deployment_settings.ocl b/.octopus/deployment_settings.ocl new file mode 100644 index 0000000..2c0b118 --- /dev/null +++ b/.octopus/deployment_settings.ocl @@ -0,0 +1,7 @@ +connectivity_policy { + allow_deployments_to_no_targets = true +} + +versioning_strategy { + template = "#{Octopus.Version.LastMajor}.#{Octopus.Version.LastMinor}.#{Octopus.Version.NextPatch}" +} \ No newline at end of file diff --git a/.octopus/schema_version.ocl b/.octopus/schema_version.ocl new file mode 100644 index 0000000..4548a61 --- /dev/null +++ b/.octopus/schema_version.ocl @@ -0,0 +1 @@ +version = 6 \ No newline at end of file diff --git a/.octopus/variables.ocl b/.octopus/variables.ocl new file mode 100644 index 0000000..940bf5b --- /dev/null +++ b/.octopus/variables.ocl @@ -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" {} +} \ No newline at end of file