terraform-provider-octopusdeploy icon indicating copy to clipboard operation
terraform-provider-octopusdeploy copied to clipboard

Example of project using a library step template

Open jrosen opened this issue 2 years ago • 0 comments
trafficstars

Describe the solution you'd like I am trying to use a step template I've developed for a custom slack notification in a project deployment process. I can see the action_template section I can use to define the template to use and which version. How do I supply properties to feed to that template? I see there is a properties attribute I can use in the run_script_action... but I get the warning it is deprecated. What is the current right way to do it?

Example

resource "octopusdeploy_deployment_process" "process" {
  project_id = "${octopusdeploy_project.project.id}"

  step {
    name = "Slackbot Message"
    condition = "Success"
    run_script_action {
      condition = "Success"
      is_disabled = false
      is_required = true
      run_on_server = true
      name = "Slackbot Message"
      worker_pool_id = "WorkerPools-21"
      sort_order = 1
      script_body = "echo 0"
      properties = {
        channels = "notifications"
      }
      action_template {
        id = "ActionTemplates-303"
        version = 35
      }
    }
  }

  step {
    condition           = "Success"
    name                = "Hello world (using PowerShell)"
    package_requirement = "LetOctopusDecide"
    start_trigger       = "StartAfterPrevious"
    run_script_action {
      can_be_used_for_project_versioning = false
      condition                          = "Success"
      is_disabled                        = false
      is_required                        = true
      name                               = "Hello world (using PowerShell)"
      sort_order = 1
      script_body                        = <<-EOT
          Write-Host 'Hello world, using PowerShell'
          #TODO: Experiment with steps of your own :)
          Write-Host '[Learn more about the types of steps that are available in Octopus](https://g.octopushq.com/OnboardingAddStepsLearnMore)'
        EOT
      run_on_server                      = true
      
    }
  }
}

jrosen avatar Sep 18 '23 21:09 jrosen