Skip to content

Commit fe63a7a

Browse files
authored
Deploy a release in Octopus Deploy (#701)
* Deploy release in Octopus Deploy * Make official and update type * Rename to step.yaml * Update background color
1 parent 75d5eb3 commit fe63a7a

File tree

2 files changed

+155
-0
lines changed

2 files changed

+155
-0
lines changed
Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
version: "1.0"
2+
kind: step-type
3+
metadata:
4+
name: octopusdeploy-deploy-release
5+
version: 1.0.0
6+
title: Deploy a release in Octopus Deploy
7+
isPublic: true
8+
description: Deploy a release in Octopus Deploy
9+
sources:
10+
- "https://github.com/codefresh-io/steps/tree/master/incubating/octopusdeploy-deploy-release"
11+
stage: incubating
12+
official: true
13+
categories:
14+
- deployment
15+
icon:
16+
type: svg
17+
url: "https://cdn.jsdelivr.net/gh/codefresh-io/steps/incubating/octopusdeploy-deploy-release/deploy_release.svg"
18+
background: "#F4F6F8"
19+
maintainers:
20+
- name: OctopusDeploy
21+
examples:
22+
- workflow:
23+
deploy-release:
24+
type: octopusdeploy-deploy-release
25+
arguments:
26+
OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}"
27+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
28+
OCTOPUS_SPACE: "Spaces-1"
29+
PROJECT: "Project Name"
30+
RELEASE_NUMBER: "1.0.0"
31+
ENVIRONMENTS:
32+
- "Development"
33+
- "Production"
34+
VARIABLES:
35+
- "prompted-variable1:prompted-value1"
36+
- "prompted-variable2:prompted-value2"
37+
USE_GUIDED_FAILURE: "false"
38+
spec:
39+
arguments: |-
40+
{
41+
"definitions": {},
42+
"$schema": "http://json-schema.org/draft-07/schema#",
43+
"type": "object",
44+
"name": "octopusdeploy-deploy-release",
45+
"additionalProperties": false,
46+
"patterns": [],
47+
"required": ["OCTOPUS_API_KEY", "OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "RELEASE_NUMBER", "ENVIRONMENTS"],
48+
"properties": {
49+
"OCTOPUS_API_KEY": {
50+
"type": "string",
51+
"description": "API key for octopus deploy (required)"
52+
},
53+
"OCTOPUS_URL": {
54+
"type": "string",
55+
"description": "URL of the octopus deploy server (required)"
56+
},
57+
"OCTOPUS_SPACE": {
58+
"type": "string",
59+
"description": "API key for octopus deploy (required)"
60+
},
61+
"PROJECT": {
62+
"type": "string",
63+
"description": "The name of the project associated with this release (required)"
64+
},
65+
"RELEASE_NUMBER": {
66+
"type": "string",
67+
"description": "The release number to deploy (required)"
68+
},
69+
"ENVIRONMENTS": {
70+
"type": "array",
71+
"items": {
72+
"type": "string"
73+
},
74+
"description": "The list of environment names to deploy to (required)"
75+
},
76+
"VARIABLES": {
77+
"type": "array",
78+
"items": {
79+
"type": "string"
80+
},
81+
"description": "Set the value for a prompted variable in the format Label:Value (optional)"
82+
},
83+
"USE_GUIDED_FAILURE": {
84+
"type": "string",
85+
"description": "A multi-line list of prompted variable values. Format: name:value (optional)"
86+
}
87+
}
88+
}
89+
returns: |-
90+
{
91+
"definitions": {},
92+
"$schema": "http://json-schema.org/draft-07/schema#",
93+
"type": "object",
94+
"additionalProperties": true,
95+
"patterns": [],
96+
"required": [
97+
"DEPLOYMENTS"
98+
],
99+
"properties": {
100+
"DEPLOYMENTS": {
101+
"type": "array",
102+
"description": "The list of deployments",
103+
"items": {
104+
"type": "object",
105+
"additionalProperties": true,
106+
"patterns": [],
107+
"required": [
108+
"DeploymentId",
109+
"ServerTaskId"
110+
],
111+
"properties": {
112+
"DeploymentId": {
113+
"type": "string",
114+
"description": "The deployment Id"
115+
},
116+
"ServerTaskId": {
117+
"type": "string",
118+
"description": "The server task Id"
119+
}
120+
}
121+
}
122+
}
123+
}
124+
}
125+
stepsTemplate: |-
126+
deploy-release:
127+
name: octopusdeploy-deploy-release
128+
image: octopuslabs/octopus-cli
129+
environment:
130+
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
131+
- 'OCTOPUS_API_KEY=[[.Arguments.OCTOPUS_API_KEY]]'
132+
- 'OCTOPUS_SPACE=[[.Arguments.OCTOPUS_SPACE]]'
133+
commands:
134+
- OUTPUT=$(octopus release deploy
135+
--project "[[.Arguments.PROJECT]]"
136+
--version "[[.Arguments.RELEASE_NUMBER]]"
137+
--no-prompt
138+
--output-format json
139+
[[- range $val := .Arguments.ENVIRONMENTS ]] --environment "[[ $val ]]" [[ end ]]
140+
[[- range $val := .Arguments.VARIABLES ]] --variable "[[ $val ]]" [[ end ]]
141+
[[- if .Arguments.USE_GUIDED_FAILURE ]] --guided-failure "[[ .Arguments.USE_GUIDED_FAILURE ]]" [[ end ]])
142+
- cf_export DEPLOYMENTS=$OUTPUT
143+
delimiters:
144+
left: "[["
145+
right: "]]"

0 commit comments

Comments
 (0)