Skip to content

Commit

Permalink
fix: [CDS-69453]: Updated the example (#566)
Browse files Browse the repository at this point in the history
* fix: [CDS-69453]: Updated the example

* fix: [CDS-69453]: Updated the example

* fix: [CDS-69453]: Updated the example
  • Loading branch information
shivamnegi94 committed Jun 5, 2023
1 parent edaa331 commit 452326c
Show file tree
Hide file tree
Showing 3 changed files with 465 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/566.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
examples/resources/harness_platform_template/ - updated the remote template example
```
231 changes: 231 additions & 0 deletions docs/resources/platform_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,80 @@ template:
EOT
}
## Remote Pipeline template to create new branch from existing base branch
resource "harness_platform_template" "pipeline_template_remote" {
identifier = "identifier"
org_id = harness_platform_project.test.org_id
project_id = harness_platform_project.test.id
name = "name"
comments = "comments"
version = "ab"
is_stable = true
git_details {
branch_name = "new_branch"
commit_message = "Commit"
file_path = "file_path"
connector_ref = "account.connector_ref"
store_type = "REMOTE"
repo_name = "repo_name"
base_branch = "main"
}
template_yaml = <<-EOT
template:
name: "name"
identifier: "identifier"
versionLabel: "ab"
type: Pipeline
projectIdentifier: ${harness_platform_project.test.id}
orgIdentifier: ${harness_platform_project.test.org_id}
tags: {}
spec:
stages:
- stage:
identifier: dvvdvd
name: dvvdvd
description: ""
type: Deployment
spec:
deploymentType: Kubernetes
service:
serviceRef: <+input>
serviceInputs: <+input>
environment:
environmentRef: <+input>
deployToAll: false
environmentInputs: <+input>
serviceOverrideInputs: <+input>
infrastructureDefinitions: <+input>
execution:
steps:
- step:
name: Rollout Deployment
identifier: rolloutDeployment
type: K8sRollingDeploy
timeout: 10m
spec:
skipDryRun: false
pruningEnabled: false
rollbackSteps:
- step:
name: Rollback Rollout Deployment
identifier: rollbackRolloutDeployment
type: K8sRollingRollback
timeout: 10m
spec:
pruningEnabled: false
tags: {}
failureStrategies:
- onFailure:
errors:
- AllErrors
action:
type: StageRollback
EOT
}
## Inline Pipeline template
resource "harness_platform_template" "pipeline_template_inline" {
identifier = "identifier"
Expand Down Expand Up @@ -227,6 +301,49 @@ template:
EOT
}
## Remote Step template to create new branch from existing branch
resource "harness_platform_template" "step_template_remote" {
identifier = "identifier"
org_id = harness_platform_project.test.org_id
project_id = harness_platform_project.test.id
name = "name"
comments = "comments"
version = "ab"
is_stable = true
git_details {
branch_name = "new_branch"
commit_message = "Commit"
file_path = "file_path"
connector_ref = "account.connector_ref"
store_type = "REMOTE"
repo_name = "repo_name"
base_branch = "main"
}
template_yaml = <<-EOT
template:
name: "name"
identifier: "identifier"
versionLabel: "ab"
type: Step
projectIdentifier: ${harness_platform_project.test.id}
orgIdentifier: ${harness_platform_project.test.org_id}
tags: {}
spec:
timeout: 10m
type: ShellScript
spec:
shell: Bash
onDelegate: true
source:
type: Inline
spec:
script: <+input>
environmentVariables: []
outputVariables: []
EOT
}
## Inline Stage template
resource "harness_platform_template" "stage_template_inline" {
identifier = "identifier"
Expand Down Expand Up @@ -349,6 +466,72 @@ template:
EOT
}
## Remote Stage template to create new branch from existing branch
resource "harness_platform_template" "stage_template_remote" {
identifier = "identifier"
org_id = harness_platform_project.test.org_id
project_id = harness_platform_project.test.id
name = "name"
comments = "comments"
version = "ab"
is_stable = true
git_details {
branch_name = "new_branch"
commit_message = "Commit"
file_path = "file_path"
connector_ref = "account.connector_ref"
store_type = "REMOTE"
repo_name = "repo_name"
base_branch = "main"
}
template_yaml = <<-EOT
template:
name: "name"
identifier: "identifier"
versionLabel: "ab"
type: Stage
projectIdentifier: ${harness_platform_project.test.id}
orgIdentifier: ${harness_platform_project.test.org_id}
tags: {}
spec:
type: Deployment
spec:
deploymentType: Kubernetes
service:
serviceRef: <+input>
serviceInputs: <+input>
environment:
environmentRef: <+input>
deployToAll: false
environmentInputs: <+input>
infrastructureDefinitions: <+input>
execution:
steps:
- step:
type: ShellScript
name: Shell Script_1
identifier: ShellScript_1
spec:
shell: Bash
onDelegate: true
source:
type: Inline
spec:
script: <+input>
environmentVariables: []
outputVariables: []
timeout: <+input>
rollbackSteps: []
failureStrategies:
- onFailure:
errors:
- AllErrors
action:
type: StageRollback
EOT
}
## Inline StepGroup template
resource "harness_platform_template" "stepgroup_template_inline" {
identifier = "identifier"
Expand Down Expand Up @@ -435,6 +618,54 @@ template:
EOT
}
## Remote StepGroup template to create new branch from existing branch
resource "harness_platform_template" "stepgroup_template_remote" {
identifier = "identifier"
org_id = harness_platform_project.test.org_id
project_id = harness_platform_project.test.id
name = "name"
comments = "comments"
version = "ab"
is_stable = true
git_details {
branch_name = "new_branch"
commit_message = "Commit"
file_path = "file_path"
connector_ref = "account.connector_ref"
store_type = "REMOTE"
repo_name = "repo_name"
base_branch = "main"
}
template_yaml = <<-EOT
template:
name: "name"
identifier: "identifier"
versionLabel: "ab"
type: StepGroup
projectIdentifier: ${harness_platform_project.test.id}
orgIdentifier: ${harness_platform_project.test.org_id}
tags: {}
spec:
stageType: Deployment
steps:
- step:
type: ShellScript
name: Shell Script_1
identifier: ShellScript_1
spec:
shell: Bash
onDelegate: true
source:
type: Inline
spec:
script: <+input>
environmentVariables: []
outputVariables: []
timeout: 10m
EOT
}
## Inline Monitered Service template
resource "harness_platform_template" "monitered_service_template_inline" {
identifier = "identifier"
Expand Down
Loading

0 comments on commit 452326c

Please sign in to comment.