Skip to content

Commit 8bbae50

Browse files
Allow access key auth for run-runbook
1 parent a910f90 commit 8bbae50

File tree

1 file changed

+53
-7
lines changed
  • incubating/octopusdeploy-run-runbook

1 file changed

+53
-7
lines changed

incubating/octopusdeploy-run-runbook/step.yaml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "1.0"
22
kind: step-type
33
metadata:
44
name: octopusdeploy-run-runbook
5-
version: 1.0.0
5+
version: 1.0.1
66
title: Run a runbook in Octopus Deploy
77
isPublic: true
88
description: Run a runbook in Octopus Deploy
@@ -19,7 +19,7 @@ metadata:
1919
maintainers:
2020
- name: OctopusDeploy
2121
examples:
22-
- description: Basic usage of the run a runbook step
22+
- description: Basic usage of the run a runbook step with API key
2323
workflow:
2424
run-runbook:
2525
type: octopusdeploy-run-runbook
@@ -32,7 +32,7 @@ metadata:
3232
ENVIRONMENTS:
3333
- "Development"
3434
- "Production"
35-
- description: Complex usage of the run a runbook step
35+
- description: Complex usage of the run a runbook step with API key
3636
workflow:
3737
run-runbook:
3838
type: octopusdeploy-run-runbook
@@ -52,6 +52,39 @@ metadata:
5252
TENANT_TAGS:
5353
- "Tenant tag 1"
5454
USE_GUIDED_FAILURE: "false"
55+
- description: Basic usage of the run a runbook step with Octopus access token
56+
workflow:
57+
run-runbook:
58+
type: octopusdeploy-run-runbook
59+
arguments:
60+
OCTOPUS_ACCESS_TOKEN: "${{OCTOPUS_ACCESS_TOKEN}}"
61+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
62+
OCTOPUS_SPACE: "Spaces 1"
63+
PROJECT: "Project Name"
64+
NAME: "Runbook Name"
65+
ENVIRONMENTS:
66+
- "Development"
67+
- "Production"
68+
- description: Complex usage of the run a runbook step with Octopus access token
69+
workflow:
70+
run-runbook:
71+
type: octopusdeploy-run-runbook
72+
arguments:
73+
OCTOPUS_ACCESS_TOKEN: "${{OCTOPUS_ACCESS_TOKEN}}"
74+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
75+
OCTOPUS_SPACE: "Spaces 1"
76+
PROJECT: "Project Name"
77+
NAME: "Runbook Name"
78+
ENVIRONMENTS:
79+
- "Development"
80+
- "Production"
81+
VARIABLES:
82+
- "Label:Value"
83+
TENANTS:
84+
- "Tenant 1"
85+
TENANT_TAGS:
86+
- "Tenant tag 1"
87+
USE_GUIDED_FAILURE: "false"
5588
spec:
5689
arguments: |-
5790
{
@@ -61,19 +94,27 @@ spec:
6194
"name": "octopusdeploy-run-runbook",
6295
"additionalProperties": false,
6396
"patterns": [],
64-
"required": ["OCTOPUS_API_KEY", "OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "NAME", "ENVIRONMENTS"],
97+
"required": ["OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "NAME", "ENVIRONMENTS"],
98+
"oneOf": [
99+
{"required": ["OCTOPUS_API_KEY"]},
100+
{"required": ["OCTOPUS_ACCESS_TOKEN"]}
101+
],
65102
"properties": {
66103
"OCTOPUS_API_KEY": {
67104
"type": "string",
68-
"description": "API key for octopus deploy (required)"
105+
"description": "API key for octopus deploy (required when OCTOPUS_ACCESS_TOKEN is not provided)"
106+
},
107+
"OCTOPUS_ACCESS_TOKEN": {
108+
"type": "string",
109+
"description": "Access token for octopus deploy (required when OCTOPUS_API_KEY is not provided)"
69110
},
70111
"OCTOPUS_URL": {
71112
"type": "string",
72113
"description": "URL of the octopus deploy server (required)"
73114
},
74115
"OCTOPUS_SPACE": {
75116
"type": "string",
76-
"description": "API key for octopus deploy (required)"
117+
"description": "Workspace for octopus deploy (required)"
77118
},
78119
"PROJECT": {
79120
"type": "string",
@@ -171,8 +212,13 @@ spec:
171212
--no-prompt)
172213
- cf_export RUNBOOK_RUNS=$OUTPUT
173214
environment:
174-
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
215+
[[ if .Arguments.OCTOPUS_API_KEY ]]
175216
- 'OCTOPUS_API_KEY=[[.Arguments.OCTOPUS_API_KEY]]'
217+
[[- end ]]
218+
[[ if .Arguments.OCTOPUS_ACCESS_TOKEN ]]
219+
- 'OCTOPUS_ACCESS_TOKEN=[[.Arguments.OCTOPUS_ACCESS_TOKEN]]'
220+
[[- end ]]
221+
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
176222
- 'OCTOPUS_SPACE=[[.Arguments.OCTOPUS_SPACE]]'
177223
delimiters:
178224
left: "[["

0 commit comments

Comments
 (0)