-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for built_in_trigger
- Loading branch information
1 parent
bd8daa9
commit ef5492c
Showing
3 changed files
with
209 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "octopusdeploy_built_in_trigger Resource - terraform-provider-octopusdeploy" | ||
subcategory: "" | ||
description: |- | ||
This resource manages automatic release trigger based on new version of referenced package. | ||
--- | ||
|
||
# octopusdeploy_built_in_trigger (Resource) | ||
|
||
This resource manages automatic release trigger based on new version of referenced package. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "octopusdeploy_project_group" "example" { | ||
name = "Example" | ||
description = "Example Group" | ||
} | ||
resource "octopusdeploy_project" "example" { | ||
name = "Example" | ||
lifecycle_id = "Lifecycles-101" | ||
project_group_id = octopusdeploy_project_group.example.id | ||
default_guided_failure_mode = "EnvironmentDefault" | ||
default_to_skip_if_already_installed = false | ||
description = "Project with Built-In Trigger" | ||
discrete_channel_release = false | ||
is_disabled = false | ||
is_discrete_channel_release = false | ||
is_version_controlled = false | ||
tenanted_deployment_participation = "Untenanted" | ||
included_library_variable_sets = [] | ||
connectivity_policy { | ||
allow_deployments_to_no_targets = false | ||
exclude_unhealthy_targets = false | ||
skip_machine_behavior = "SkipUnavailableMachines" | ||
} | ||
} | ||
resource "octopusdeploy_channel" "example" { | ||
name = "Example Channel" | ||
project_id = octopusdeploy_project.example.id | ||
lifecycle_id = "Lifecycles-101" | ||
} | ||
data "octopusdeploy_feeds" "built_in" { | ||
feed_type = "BuiltIn" | ||
ids = null | ||
partial_name = "" | ||
skip = 0 | ||
take = 1 | ||
} | ||
resource "octopusdeploy_deployment_process" "example" { | ||
project_id = octopusdeploy_project.example.id | ||
step { | ||
condition = "Success" | ||
name = "Step One" | ||
package_requirement = "LetOctopusDecide" | ||
start_trigger = "StartAfterPrevious" | ||
run_script_action { | ||
condition = "Success" | ||
is_disabled = false | ||
is_required = true | ||
name = "Action One" | ||
script_body = <<-EOT | ||
$ExtractedPath = $OctopusParameters["Octopus.Action.Package[my.package].ExtractedPath"] | ||
Write-Host $ExtractedPath | ||
EOT | ||
run_on_server = true | ||
package { | ||
name = "my.package" | ||
package_id = "my.package" | ||
feed_id = data.octopusdeploy_feeds.built_in.feeds[0].id | ||
acquisition_location = "Server" | ||
extract_during_deployment = true | ||
} | ||
} | ||
} | ||
} | ||
resource "octopusdeploy_built_in_trigger" "example" { | ||
project_id = octopusdeploy_project.example.id | ||
channel_id = octopusdeploy_channel.example.id | ||
release_creation_package = { | ||
deployment_action = "Action One" | ||
package_reference = "my.package" | ||
} | ||
depends_on = [ | ||
octopusdeploy_project.example, | ||
octopusdeploy_channel.example, | ||
octopusdeploy_deployment_process.example | ||
] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `channel_id` (String) The ID of the channel in which triggered release will be created. | ||
- `project_id` (String) The ID of the project the trigger will be attached to. | ||
- `release_creation_package` (Attributes) Combination of deployment action and package references. (see [below for nested schema](#nestedatt--release_creation_package)) | ||
|
||
### Optional | ||
|
||
- `release_creation_package_step_id` (String) The package step ID trigger will be listening. | ||
- `space_id` (String) Space ID of the associated project. | ||
|
||
<a id="nestedatt--release_creation_package"></a> | ||
### Nested Schema for `release_creation_package` | ||
|
||
Optional: | ||
|
||
- `deployment_action` (String) Deployment action. | ||
- `package_reference` (String) Package reference. | ||
|
||
|
84 changes: 84 additions & 0 deletions
84
examples/resources/octopusdeploy_built_in_trigger/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
resource "octopusdeploy_project_group" "example" { | ||
name = "Example" | ||
description = "Example Group" | ||
} | ||
|
||
resource "octopusdeploy_project" "example" { | ||
name = "Example" | ||
lifecycle_id = "Lifecycles-101" | ||
project_group_id = octopusdeploy_project_group.example.id | ||
default_guided_failure_mode = "EnvironmentDefault" | ||
default_to_skip_if_already_installed = false | ||
description = "Project with Built-In Trigger" | ||
discrete_channel_release = false | ||
is_disabled = false | ||
is_discrete_channel_release = false | ||
is_version_controlled = false | ||
tenanted_deployment_participation = "Untenanted" | ||
included_library_variable_sets = [] | ||
|
||
connectivity_policy { | ||
allow_deployments_to_no_targets = false | ||
exclude_unhealthy_targets = false | ||
skip_machine_behavior = "SkipUnavailableMachines" | ||
} | ||
} | ||
|
||
resource "octopusdeploy_channel" "example" { | ||
name = "Example Channel" | ||
project_id = octopusdeploy_project.example.id | ||
lifecycle_id = "Lifecycles-101" | ||
} | ||
|
||
data "octopusdeploy_feeds" "built_in" { | ||
feed_type = "BuiltIn" | ||
ids = null | ||
partial_name = "" | ||
skip = 0 | ||
take = 1 | ||
} | ||
|
||
resource "octopusdeploy_deployment_process" "example" { | ||
project_id = octopusdeploy_project.example.id | ||
step { | ||
condition = "Success" | ||
name = "Step One" | ||
package_requirement = "LetOctopusDecide" | ||
start_trigger = "StartAfterPrevious" | ||
run_script_action { | ||
condition = "Success" | ||
is_disabled = false | ||
is_required = true | ||
name = "Action One" | ||
script_body = <<-EOT | ||
$ExtractedPath = $OctopusParameters["Octopus.Action.Package[my.package].ExtractedPath"] | ||
Write-Host $ExtractedPath | ||
EOT | ||
run_on_server = true | ||
|
||
package { | ||
name = "my.package" | ||
package_id = "my.package" | ||
feed_id = data.octopusdeploy_feeds.built_in.feeds[0].id | ||
acquisition_location = "Server" | ||
extract_during_deployment = true | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource "octopusdeploy_built_in_trigger" "example" { | ||
project_id = octopusdeploy_project.example.id | ||
channel_id = octopusdeploy_channel.example.id | ||
|
||
release_creation_package = { | ||
deployment_action = "Action One" | ||
package_reference = "my.package" | ||
} | ||
|
||
depends_on = [ | ||
octopusdeploy_project.example, | ||
octopusdeploy_channel.example, | ||
octopusdeploy_deployment_process.example | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters