Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/resources/octopusdeploy_lifecycle/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ resource "octopusdeploy_lifecycle" "example" {
name = "bar"
optional_deployment_targets = ["Environments-321"]
}

phase {
is_optional_phase = true
name = "priority phase"
is_priority_phase = true
optional_deployment_targets = ["Environments-321"]
}
}
11 changes: 11 additions & 0 deletions octopusdeploy/schema_phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func expandPhase(flattenedPhase interface{}) *lifecycles.Phase {
phase.IsOptionalPhase = v.(bool)
}

if v, ok := flattenedValues["is_priority_phase"]; ok {
phase.IsPriorityPhase = v.(bool)
}

if v, ok := flattenedValues["minimum_environments_before_promotion"]; ok {
if n, isInt32 := v.(int32); isInt32 {
phase.MinimumEnvironmentsBeforePromotion = n
Expand Down Expand Up @@ -91,6 +95,7 @@ func flattenPhase(phase *lifecycles.Phase) interface{} {
flattenedPhase["automatic_deployment_targets"] = flattenArray(phase.AutomaticDeploymentTargets)
flattenedPhase["id"] = phase.ID
flattenedPhase["is_optional_phase"] = phase.IsOptionalPhase
flattenedPhase["is_priority_phase"] = phase.IsPriorityPhase
flattenedPhase["minimum_environments_before_promotion"] = int(phase.MinimumEnvironmentsBeforePromotion)
flattenedPhase["name"] = phase.Name
flattenedPhase["optional_deployment_targets"] = flattenArray(phase.OptionalDeploymentTargets)
Expand Down Expand Up @@ -127,6 +132,12 @@ func getPhaseSchema() map[string]*schema.Schema {
Optional: true,
Type: schema.TypeBool,
},
"is_priority_phase": {
Default: false,
Description: "If true, deployments in this phase will be prioritized in the task queue.",
Optional: true,
Type: schema.TypeBool,
},
"minimum_environments_before_promotion": {
Default: 0,
Description: "The number of units required before a release can enter the next phase. If 0, all environments are required.",
Expand Down