Compare commits
11 Commits
release/1.
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ff48c3a35 | ||
| 43371eaf10 | |||
| f3ffff7d94 | |||
| 554066cd4b | |||
| dc049508b9 | |||
| b3f21b6113 | |||
| 9c52840bc5 | |||
|
|
1f17866b90 | ||
|
|
3f9116f88f | ||
| 39a61204f9 | |||
| 523ccc4a83 |
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
default_guided_failure_mode = "On"
|
||||
|
||||
connectivity_policy {
|
||||
allow_deployments_to_no_targets = true
|
||||
}
|
||||
|
||||
@@ -23,4 +23,8 @@ variable "RUNSPACE_GITLAB_PROJECT_IMPORT" {
|
||||
|
||||
variable "TF_INIT" {
|
||||
value "-backend-config=\"address=https://gitlab.com/api/v4/projects/#{GITLAB_PROJECT_ID}/terraform/state/#{Octopus.Deployment.Tenant.Id}\" -backend-config=\"lock_address=https://gitlab.com/api/v4/projects/#{GITLAB_PROJECT_ID}/terraform/state/#{Octopus.Deployment.Tenant.Id}/lock\" -backend-config=\"unlock_address=https://gitlab.com/api/v4/projects/#{GITLAB_PROJECT_ID}/terraform/state/#{Octopus.Deployment.Tenant.Id}/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 "OCTO_TENANT_ID" {
|
||||
value "#{Octopus.Deployment.Tenant.Id}" {}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -11,6 +11,11 @@ variable "GITLAB_SHARED_RUNNER_ID" {
|
||||
default = 0
|
||||
}
|
||||
|
||||
variable "Enable_OCTOAPI" {
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "OCTOAPI" {
|
||||
type = string
|
||||
default = ""
|
||||
|
||||
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user