OctopusDeployLabs / terraform-provider-octopusdeploy

Terraform Provider for Octopus Deploy :octopus:
https://registry.terraform.io/providers/OctopusDeployLabs/octopusdeploy
Mozilla Public License 2.0
81 stars 67 forks source link

Add ability to consume Step Templates in Deployment Processes #137

Open Shanjohn opened 3 years ago

Shanjohn commented 3 years ago

Is there a plan to support usage of step templates in octopusdeploy_deployment_process in the future?

ray-jam commented 3 years ago

I managed to get something working via a standard step action:

  step {
    name      = "Terraform - PlanV2"
    condition = "Success"
    start_trigger = "StartAfterPrevious"
    action {
      action_type                        = "Octopus.TerraformPlan"
      can_be_used_for_project_versioning = true
      is_disabled = false
      is_required = true
      name        = "Terraform - PlanV2"
      properties = {
        "Octopus.Action.Package.DownloadOnTentacle"             = "False"
        "Octopus.Action.Package.FeedId"                         = "feeds-builtin"
        "Octopus.Action.Package.PackageId"                      = "#{Octopus.Project.Name}"
        "Octopus.Action.Script.ScriptSource"                    = "Package"
        "Octopus.Action.Template.Id"                            = "ActionTemplates-123"
        "Octopus.Action.Template.Version"                       = "3"

Found it useful to import from existing projects to get a working solution:

From that information you can build you terraform code to suit the step template and clear out your temporary bits. May not be the long term best solution but for now it means we can proceed with deploying our OD build processes using step templates.

jbristowe commented 3 years ago

The octopusdeploy_deployment_process resource has support for step lists. An example has been included in the documentation found in the Terraform Registry.

Is there something missing?

Shanjohn commented 3 years ago

@jbristowe It is completely ok for usual steps, but what about step templates ? When you use it, the right solution seems to be just to pass step template parameters as we do in GUI, but here we need to basically copy all of internal step template insides via properties manually

blytheaw commented 3 years ago

I'm unclear on if using library step templates within the deployment process is actually supported. I raised issue #184 because I can't seem to import a deployment process that uses a library step template.

Additionally, I can't seem to create a new deployment resource using a library step template without specifying all the properties of the library step template directly, which defeats the purpose, as @Shanjohn mentioned above.

@jbristowe can you provide some clarity on if this pattern is supported for the octopusdeploy_deployment_process resource?

angusmcdonald commented 3 years ago

The properties can be attached by including add them in the properties object in the deploy_package_action

I just raised a ticket #196 (which most likely can be linked to this) as this object has been flagged to be deprecated and its seems like a workaround

an example of this workaround is in there

chathsuom commented 2 years ago

I am also facing the same issue. We can't use step template without defining the content of the step template.

waylew50 commented 2 years ago

any update on this. I also get this warning in v0.8.1 "Warning: Argument is deprecated │ │ with module.project.octopusdeploy_deployment_process.main, │ on ....\modules\project\process.tf line 24, in resource "octopusdeploy_deployment_process" "main": │ 24: properties = {

seems like the work around for using properties to reference step templates. may be impacted by this in a coming release? hopefully, there are plans for a step_template resources and data blocks?

lee5i3 commented 1 year ago

I'm really hoping for progress on this, being able to keep step templates in sync across spaces would be a big help!

We currently have around 100 deployments which are identical over 5 spaces, would be nice to be able to keep the same deployment processes the same.

Clare-Octopus commented 6 months ago

Another user seeing this issue (internal) - https://octopus.zendesk.com/agent/tickets/172218

donnybell commented 5 months ago

Another affected user [Internal Link]

haraldsk commented 3 months ago

Just want to chime in that this is an issue for us as well, and working around it makes our code become really messy. It would be great if it got some traction.

mjhilton commented 1 week ago

Agreed that though you can technically use a Step Template in a Deployment Process via Terraform, doing so basically negates the benefits that step templates bring. It's very messy and involves "copying" the logic of the Step Template into the properties of the action in the process. I'd love for us to fix this.

For the ability to define/manage Step Templates themselves, see #145