From 247250a1548fd5d683b00a2c4918cbdc5a677a3a Mon Sep 17 00:00:00 2001 From: Lourens de Jager <165963988+lourens-octopus@users.noreply.github.com> Date: Mon, 16 Dec 2024 09:04:35 +1300 Subject: [PATCH] fix: Add Git trigger example --- docs/resources/git_trigger.md | 30 ++++++++++++++++++- .../octopusdeploy_git_trigger/import.sh | 1 + .../octopusdeploy_git_trigger/resource.tf | 19 ++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 examples/resources/octopusdeploy_git_trigger/import.sh create mode 100644 examples/resources/octopusdeploy_git_trigger/resource.tf diff --git a/docs/resources/git_trigger.md b/docs/resources/git_trigger.md index 6376c904..0200e239 100644 --- a/docs/resources/git_trigger.md +++ b/docs/resources/git_trigger.md @@ -10,7 +10,29 @@ description: |- This resource manages Git triggers in Octopus Deploy - +## Example Usage + +```terraform +resource "octopusdeploy_git_trigger" "my_trigger" { + name = "My Git trigger" + space_id = "Spaces-1" + description = "My Git trigger description" + project_id = "Projects-1" + channel_id = "Channels-1" + sources { + deployment_action_slug = "deploy-action-slug" + git_dependency_name = "" + include_file_paths = [ + "include/me", + "include/me/too" + ] + exclude_file_paths = [ + "exclude/me", + "exclude/me/too" + ] + } +} +``` ## Schema @@ -42,4 +64,10 @@ Required: - `git_dependency_name` (String) The git dependency name. - `include_file_paths` (List of String) The file paths to include. +## Import + +Import is supported using the following syntax: +```shell +terraform import [options] octopusdeploy_git_trigger. +``` diff --git a/examples/resources/octopusdeploy_git_trigger/import.sh b/examples/resources/octopusdeploy_git_trigger/import.sh new file mode 100644 index 00000000..38f0466b --- /dev/null +++ b/examples/resources/octopusdeploy_git_trigger/import.sh @@ -0,0 +1 @@ +terraform import [options] octopusdeploy_git_trigger. \ No newline at end of file diff --git a/examples/resources/octopusdeploy_git_trigger/resource.tf b/examples/resources/octopusdeploy_git_trigger/resource.tf new file mode 100644 index 00000000..429d0289 --- /dev/null +++ b/examples/resources/octopusdeploy_git_trigger/resource.tf @@ -0,0 +1,19 @@ +resource "octopusdeploy_git_trigger" "my_trigger" { + name = "My Git trigger" + space_id = "Spaces-1" + description = "My Git trigger description" + project_id = "Projects-1" + channel_id = "Channels-1" + sources { + deployment_action_slug = "deploy-action-slug" + git_dependency_name = "" + include_file_paths = [ + "include/me", + "include/me/too" + ] + exclude_file_paths = [ + "exclude/me", + "exclude/me/too" + ] + } +}