Skip to content

Commit 1e9e7f3

Browse files
Add Octopus login step (#711)
* Add Octopus login step * Allow access key auth for create-release * Allow access key auth for deploy-release * Allow access key auth for deploy-release-tenanted * Allow access key auth for push-build-information * Allow access key auth for push-package * Allow access key auth for run-runbook * Add login step to workflow examples
1 parent 9e5e01e commit 1e9e7f3

File tree

8 files changed

+398
-39
lines changed

8 files changed

+398
-39
lines changed

incubating/octopusdeploy-create-release/step.yaml

+60-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "1.0"
22
kind: step-type
33
metadata:
44
name: octopusdeploy-create-release
5-
version: 1.0.0
5+
version: 1.0.1
66
title: Create a release in Octopus Deploy
77
isPublic: true
88
description: Create a release in Octopus Deploy
@@ -19,7 +19,7 @@ metadata:
1919
maintainers:
2020
- name: OctopusDeploy
2121
examples:
22-
- description: Basic usage of the create release step
22+
- description: Basic usage of the create release step with API key
2323
workflow:
2424
create-release:
2525
type: octopusdeploy-create-release
@@ -28,7 +28,7 @@ metadata:
2828
OCTOPUS_URL: "${{OCTOPUS_URL}}"
2929
OCTOPUS_SPACE: "Spaces 1"
3030
PROJECT: "Project Name"
31-
- description: Complex usage of the create release step
31+
- description: Complex usage of the create release step with API key
3232
workflow:
3333
create-release:
3434
type: octopusdeploy-create-release
@@ -47,6 +47,46 @@ metadata:
4747
RELEASE_NOTES: "This is a release note"
4848
RELEASE_NOTES_FILE: "/release-notes.txt"
4949
IGNORE_EXISTING: false
50+
- description: Basic usage of the create release step with Octopus access token
51+
workflow:
52+
login:
53+
type: octopusdeploy-login
54+
arguments:
55+
ID_TOKEN: "${{ID_TOKEN}}"
56+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
57+
OCTOPUS_SERVICE_ACCOUNT_ID: "${{OCTOPUS_SERVICE_ACCOUNT_ID}}"
58+
create-release:
59+
type: octopusdeploy-create-release
60+
arguments:
61+
OCTOPUS_ACCESS_TOKEN: "${{OCTOPUS_ACCESS_TOKEN}}"
62+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
63+
OCTOPUS_SPACE: "Spaces 1"
64+
PROJECT: "Project Name"
65+
- description: Complex usage of the create release step with Octopus access token
66+
workflow:
67+
login:
68+
type: octopusdeploy-login
69+
arguments:
70+
ID_TOKEN: "${{ID_TOKEN}}"
71+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
72+
OCTOPUS_SERVICE_ACCOUNT_ID: "${{OCTOPUS_SERVICE_ACCOUNT_ID}}"
73+
create-release:
74+
type: octopusdeploy-create-release
75+
arguments:
76+
OCTOPUS_ACCESS_TOKEN: "${{OCTOPUS_ACCESS_TOKEN}}"
77+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
78+
OCTOPUS_SPACE: "Spaces 1"
79+
PROJECT: "Project Name"
80+
RELEASE_NUMBER: "1.0.0"
81+
CHANNEL: "Channel Name"
82+
GIT_REF: "refs/heads/main"
83+
GIT_COMMIT: "Commit ID"
84+
PACKAGE_VERSION: "1.0.0"
85+
PACKAGES:
86+
- "Package:1.0.0"
87+
RELEASE_NOTES: "This is a release note"
88+
RELEASE_NOTES_FILE: "/release-notes.txt"
89+
IGNORE_EXISTING: false
5090
spec:
5191
arguments: |-
5292
{
@@ -56,19 +96,27 @@ spec:
5696
"name": "octopusdeploy-create-release",
5797
"additionalProperties": false,
5898
"patterns": [],
59-
"required": ["OCTOPUS_API_KEY", "OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT"],
99+
"required": ["OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT"],
100+
"oneOf": [
101+
{"required": ["OCTOPUS_API_KEY"]},
102+
{"required": ["OCTOPUS_ACCESS_TOKEN"]}
103+
],
60104
"properties": {
61105
"OCTOPUS_API_KEY": {
62106
"type": "string",
63-
"description": "API key for octopus deploy (required)"
107+
"description": "API key for octopus deploy (required when OCTOPUS_ACCESS_TOKEN is not provided)"
108+
},
109+
"OCTOPUS_ACCESS_TOKEN": {
110+
"type": "string",
111+
"description": "Access token for octopus deploy (required when OCTOPUS_API_KEY is not provided)"
64112
},
65113
"OCTOPUS_URL": {
66114
"type": "string",
67115
"description": "URL of the octopus deploy server (required)"
68116
},
69117
"OCTOPUS_SPACE": {
70118
"type": "string",
71-
"description": "API key for octopus deploy (required)"
119+
"description": "Workspace for octopus deploy (required)"
72120
},
73121
"PROJECT": {
74122
"type": "string",
@@ -149,8 +197,13 @@ spec:
149197
[[- if .Arguments.IGNORE_EXISTING ]] --ignore-existing [[ end ]])
150198
- cf_export RELEASE=$OUTPUT
151199
environment:
152-
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
200+
[[ if .Arguments.OCTOPUS_API_KEY ]]
153201
- 'OCTOPUS_API_KEY=[[.Arguments.OCTOPUS_API_KEY]]'
202+
[[- end ]]
203+
[[ if .Arguments.OCTOPUS_ACCESS_TOKEN ]]
204+
- 'OCTOPUS_ACCESS_TOKEN=[[.Arguments.OCTOPUS_ACCESS_TOKEN]]'
205+
[[- end ]]
206+
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
154207
- 'OCTOPUS_SPACE=[[.Arguments.OCTOPUS_SPACE]]'
155208
delimiters:
156209
left: "[["

incubating/octopusdeploy-deploy-release-tenanted/step.yaml

+64-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "1.0"
22
kind: step-type
33
metadata:
44
name: octopusdeploy-deploy-release-tenanted
5-
version: 1.0.1
5+
version: 1.0.2
66
title: Deploy a tenanted release in Octopus Deploy
77
isPublic: true
88
description: Deploy a tenanted release in Octopus Deploy
@@ -19,7 +19,7 @@ metadata:
1919
maintainers:
2020
- name: OctopusDeploy
2121
examples:
22-
- description: "Deploy using tenant name"
22+
- description: "Deploy using tenant name and API key"
2323
workflow:
2424
deploy-release-tenanted:
2525
type: octopusdeploy-deploy-release-tenanted
@@ -37,7 +37,7 @@ metadata:
3737
- "prompted-variable1:prompted-value1"
3838
- "prompted-variable2:prompted-value2"
3939
USE_GUIDED_FAILURE: "false"
40-
- description: "Deploy using tenant tags"
40+
- description: "Deploy using tenant tags and API key"
4141
workflow:
4242
deploy-release-tenanted:
4343
type: octopusdeploy-deploy-release-tenanted
@@ -51,6 +51,50 @@ metadata:
5151
TENANT_TAGS:
5252
- "tagSetA/someTagB"
5353
- "tagSetC/someTagD"
54+
- description: "Deploy using tenant name and Octopus access token"
55+
workflow:
56+
login:
57+
type: octopusdeploy-login
58+
arguments:
59+
ID_TOKEN: "${{ID_TOKEN}}"
60+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
61+
OCTOPUS_SERVICE_ACCOUNT_ID: "${{OCTOPUS_SERVICE_ACCOUNT_ID}}"
62+
deploy-release-tenanted:
63+
type: octopusdeploy-deploy-release-tenanted
64+
arguments:
65+
OCTOPUS_ACCESS_TOKEN: "${{OCTOPUS_ACCESS_TOKEN}}"
66+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
67+
OCTOPUS_SPACE: "Spaces-1"
68+
PROJECT: "Project Name"
69+
RELEASE_NUMBER: "1.0.0"
70+
ENVIRONMENT: "Production"
71+
TENANTS:
72+
- "Tenant1"
73+
- "Tenant2"
74+
VARIABLES:
75+
- "prompted-variable1:prompted-value1"
76+
- "prompted-variable2:prompted-value2"
77+
USE_GUIDED_FAILURE: "false"
78+
- description: "Deploy using tenant tags and Octopus access token"
79+
workflow:
80+
login:
81+
type: octopusdeploy-login
82+
arguments:
83+
ID_TOKEN: "${{ID_TOKEN}}"
84+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
85+
OCTOPUS_SERVICE_ACCOUNT_ID: "${{OCTOPUS_SERVICE_ACCOUNT_ID}}"
86+
deploy-release-tenanted:
87+
type: octopusdeploy-deploy-release-tenanted
88+
arguments:
89+
OCTOPUS_ACCESS_TOKEN: "${{OCTOPUS_ACCESS_TOKEN}}"
90+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
91+
OCTOPUS_SPACE: "Spaces-1"
92+
PROJECT: "Another Project Name"
93+
RELEASE_NUMBER: "2.0.0"
94+
ENVIRONMENT: "Development"
95+
TENANT_TAGS:
96+
- "tagSetA/someTagB"
97+
- "tagSetC/someTagD"
5498
spec:
5599
arguments: |-
56100
{
@@ -60,19 +104,27 @@ spec:
60104
"name": "octopusdeploy-deploy-release-tenanted",
61105
"additionalProperties": false,
62106
"patterns": [],
63-
"required": ["OCTOPUS_API_KEY", "OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "RELEASE_NUMBER", "ENVIRONMENT"],
107+
"required": ["OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "RELEASE_NUMBER", "ENVIRONMENT"],
108+
"oneOf": [
109+
{"required": ["OCTOPUS_API_KEY"]},
110+
{"required": ["OCTOPUS_ACCESS_TOKEN"]}
111+
],
64112
"properties": {
65113
"OCTOPUS_API_KEY": {
66114
"type": "string",
67-
"description": "API key for octopus deploy (required)"
115+
"description": "API key for octopus deploy (required when OCTOPUS_ACCESS_TOKEN is not provided)"
116+
},
117+
"OCTOPUS_ACCESS_TOKEN": {
118+
"type": "string",
119+
"description": "Access token for octopus deploy (required when OCTOPUS_API_KEY is not provided)"
68120
},
69121
"OCTOPUS_URL": {
70122
"type": "string",
71123
"description": "URL of the octopus deploy server (required)"
72124
},
73125
"OCTOPUS_SPACE": {
74126
"type": "string",
75-
"description": "API key for octopus deploy (required)"
127+
"description": "Workspace for octopus deploy (required)"
76128
},
77129
"PROJECT": {
78130
"type": "string",
@@ -154,8 +206,13 @@ spec:
154206
name: octopusdeploy-deploy-release-tenanted
155207
image: octopuslabs/octopus-cli
156208
environment:
157-
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
209+
[[ if .Arguments.OCTOPUS_API_KEY ]]
158210
- 'OCTOPUS_API_KEY=[[.Arguments.OCTOPUS_API_KEY]]'
211+
[[- end ]]
212+
[[ if .Arguments.OCTOPUS_ACCESS_TOKEN ]]
213+
- 'OCTOPUS_ACCESS_TOKEN=[[.Arguments.OCTOPUS_ACCESS_TOKEN]]'
214+
[[- end ]]
215+
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
159216
- 'OCTOPUS_SPACE=[[.Arguments.OCTOPUS_SPACE]]'
160217
commands:
161218
- OUTPUT=$(octopus release deploy

incubating/octopusdeploy-deploy-release/step.yaml

+43-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "1.0"
22
kind: step-type
33
metadata:
44
name: octopusdeploy-deploy-release
5-
version: 1.0.0
5+
version: 1.0.1
66
title: Deploy a release in Octopus Deploy
77
isPublic: true
88
description: Deploy a release in Octopus Deploy
@@ -19,7 +19,8 @@ metadata:
1919
maintainers:
2020
- name: OctopusDeploy
2121
examples:
22-
- workflow:
22+
- description: Usage of the deploy release with API key
23+
workflow:
2324
deploy-release:
2425
type: octopusdeploy-deploy-release
2526
arguments:
@@ -35,6 +36,29 @@ metadata:
3536
- "prompted-variable1:prompted-value1"
3637
- "prompted-variable2:prompted-value2"
3738
USE_GUIDED_FAILURE: "false"
39+
- description: Usage of the deploy release with Octopus access token
40+
workflow:
41+
login:
42+
type: octopusdeploy-login
43+
arguments:
44+
ID_TOKEN: "${{ID_TOKEN}}"
45+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
46+
OCTOPUS_SERVICE_ACCOUNT_ID: "${{OCTOPUS_SERVICE_ACCOUNT_ID}}"
47+
deploy-release:
48+
type: octopusdeploy-deploy-release
49+
arguments:
50+
OCTOPUS_ACCESS_TOKEN: "${{OCTOPUS_ACCESS_TOKEN}}"
51+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
52+
OCTOPUS_SPACE: "Spaces-1"
53+
PROJECT: "Project Name"
54+
RELEASE_NUMBER: "1.0.0"
55+
ENVIRONMENTS:
56+
- "Development"
57+
- "Production"
58+
VARIABLES:
59+
- "prompted-variable1:prompted-value1"
60+
- "prompted-variable2:prompted-value2"
61+
USE_GUIDED_FAILURE: "false"
3862
spec:
3963
arguments: |-
4064
{
@@ -44,19 +68,27 @@ spec:
4468
"name": "octopusdeploy-deploy-release",
4569
"additionalProperties": false,
4670
"patterns": [],
47-
"required": ["OCTOPUS_API_KEY", "OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "RELEASE_NUMBER", "ENVIRONMENTS"],
71+
"required": ["OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "RELEASE_NUMBER", "ENVIRONMENTS"],
72+
"oneOf": [
73+
{"required": ["OCTOPUS_API_KEY"]},
74+
{"required": ["OCTOPUS_ACCESS_TOKEN"]}
75+
],
4876
"properties": {
4977
"OCTOPUS_API_KEY": {
5078
"type": "string",
51-
"description": "API key for octopus deploy (required)"
79+
"description": "API key for octopus deploy (required when OCTOPUS_ACCESS_TOKEN is not provided)"
80+
},
81+
"OCTOPUS_ACCESS_TOKEN": {
82+
"type": "string",
83+
"description": "Access token for octopus deploy (required when OCTOPUS_API_KEY is not provided)"
5284
},
5385
"OCTOPUS_URL": {
5486
"type": "string",
5587
"description": "URL of the octopus deploy server (required)"
5688
},
5789
"OCTOPUS_SPACE": {
5890
"type": "string",
59-
"description": "API key for octopus deploy (required)"
91+
"description": "Workspace for octopus deploy (required)"
6092
},
6193
"PROJECT": {
6294
"type": "string",
@@ -127,8 +159,13 @@ spec:
127159
name: octopusdeploy-deploy-release
128160
image: octopuslabs/octopus-cli
129161
environment:
130-
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
162+
[[ if .Arguments.OCTOPUS_API_KEY ]]
131163
- 'OCTOPUS_API_KEY=[[.Arguments.OCTOPUS_API_KEY]]'
164+
[[- end ]]
165+
[[ if .Arguments.OCTOPUS_ACCESS_TOKEN ]]
166+
- 'OCTOPUS_ACCESS_TOKEN=[[.Arguments.OCTOPUS_ACCESS_TOKEN]]'
167+
[[- end ]]
168+
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
132169
- 'OCTOPUS_SPACE=[[.Arguments.OCTOPUS_SPACE]]'
133170
commands:
134171
- OUTPUT=$(octopus release deploy
+7
Loading

0 commit comments

Comments
 (0)