Skip to content

Commit 814a417

Browse files
authored
Merge branch 'master' into fnm/create-release-step
2 parents dea1b1d + 1a6c1e2 commit 814a417

File tree

8 files changed

+656
-0
lines changed

8 files changed

+656
-0
lines changed
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
version: "1.0"
2+
kind: step-type
3+
metadata:
4+
name: octopusdeploy-create-package
5+
version: 1.0.0
6+
title: Create a package
7+
isPublic: true
8+
description: Creates a zip package in the format expected by Octopus Deploy
9+
sources:
10+
- "https://github.com/codefresh-io/steps/tree/master/incubating/octopusdeploy-create-package"
11+
stage: incubating
12+
official: true
13+
categories:
14+
- utility
15+
icon:
16+
type: svg
17+
url: "https://cdn.jsdelivr.net/gh/codefresh-io/steps/incubating/octopusdeploy-create-package/create_package.svg"
18+
background: "#F4F6F8"
19+
maintainers:
20+
- name: OctopusDeploy
21+
examples:
22+
- description: Package the current working directory
23+
workflow:
24+
create-package:
25+
type: octopusdeploy-create-package
26+
arguments:
27+
ID: "SomePackage"
28+
VERSION: "1.0.0"
29+
- description: Complex usage
30+
workflow:
31+
create-package:
32+
type: octopusdeploy-create-package
33+
arguments:
34+
ID: "SomePackage"
35+
VERSION: "1.0.0"
36+
BASE_PATH: "/codefresh/volume"
37+
OUT_FOLDER: "/codefresh/volume"
38+
INCLUDE:
39+
- "*.html"
40+
- "*.css"
41+
spec:
42+
arguments: |-
43+
{
44+
"definitions": {},
45+
"$schema": "http://json-schema.org/draft-07/schema#",
46+
"type": "object",
47+
"name": "octopusdeploy-create-package",
48+
"additionalProperties": false,
49+
"patterns": [],
50+
"required": ["ID", "VERSION"],
51+
"properties": {
52+
"ID": {
53+
"type": "string",
54+
"description": "The ID of the package. (required)"
55+
},
56+
"VERSION": {
57+
"type": "string",
58+
"description": "The version of the package, must be a valid SemVer. (required)"
59+
},
60+
"BASE_PATH": {
61+
"type": "string",
62+
"description": "Root folder containing the contents to zip. (optional)"
63+
},
64+
"OUT_FOLDER": {
65+
"type": "string",
66+
"description": "Folder into which the zip file will be written. (optional)"
67+
},
68+
"INCLUDE": {
69+
"type": "array",
70+
"items": {
71+
"type": "string"
72+
},
73+
"description": "Add a file pattern to include, relative to the base path e.g. /bin/*.dll; defaults to '**'. (optional)"
74+
},
75+
"OVERWRITE": {
76+
"type": "boolean",
77+
"description": "Allow an existing package file of the same ID/version to be overwritten. (optional)"
78+
}
79+
}
80+
}
81+
returns: |-
82+
{
83+
"definitions": {},
84+
"$schema": "http://json-schema.org/draft-07/schema#",
85+
"type": "object",
86+
"patterns": [],
87+
"required": [
88+
"PATH"
89+
],
90+
"properties": {
91+
"PATH": {
92+
"type": "string",
93+
"description": "The zip file path that was created"
94+
}
95+
}
96+
}
97+
stepsTemplate: |-
98+
create-package:
99+
name: octopusdeploy-create-package
100+
image: octopuslabs/octopus-cli
101+
tag: latest
102+
commands:
103+
- OUTPUT=$(octopus package zip create
104+
--id "[[ .Arguments.ID ]]"
105+
--version "[[ .Arguments.VERSION ]]"
106+
[[- if .Arguments.BASE_PATH ]] --base-path "[[ .Arguments.BASE_PATH ]]" [[ end ]]
107+
[[- if .Arguments.OUT_FOLDER ]] --out-folder "[[ .Arguments.OUT_FOLDER ]]" [[ end ]]
108+
[[- range $val := .Arguments.INCLUDE ]] --include "[[ $val ]]" [[ end ]]
109+
[[- if .Arguments.OVERWRITE ]] --overwrite [[ end ]]
110+
--output-format basic
111+
--no-prompt)
112+
- cf_export PATH="$OUTPUT"
113+
delimiters:
114+
left: "[["
115+
right: "]]"
Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
version: "1.0"
2+
kind: step-type
3+
metadata:
4+
name: octopusdeploy-deploy-release-tenanted
5+
version: 1.0.0
6+
title: Deploy a tenanted release in Octopus Deploy
7+
isPublic: true
8+
description: Deploy a tenanted release in Octopus Deploy
9+
sources:
10+
- "https://github.com/codefresh-io/steps/tree/master/incubating/octopusdeploy-deploy-release-tenanted"
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-tenanted.svg"
18+
background: "#F4F6F8"
19+
maintainers:
20+
- name: OctopusDeploy
21+
examples:
22+
- description: "Deploy using tenant name"
23+
workflow:
24+
deploy-release-tenanted:
25+
type: octopusdeploy-deploy-release-tenanted
26+
arguments:
27+
OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}"
28+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
29+
OCTOPUS_SPACE: "Spaces-1"
30+
PROJECT: "Project Name"
31+
RELEASE_NUMBER: "1.0.0"
32+
ENVIRONMENT: "Production"
33+
TENANTS:
34+
- "Tenant1"
35+
- "Tenant2"
36+
VARIABLES:
37+
- "prompted-variable1:prompted-value1"
38+
- "prompted-variable2:prompted-value2"
39+
USE_GUIDED_FAILURE: "false"
40+
- description: "Deploy using tenant tags"
41+
workflow:
42+
deploy-release-tenanted:
43+
type: octopusdeploy-deploy-release-tenanted
44+
arguments:
45+
OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}"
46+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
47+
OCTOPUS_SPACE: "Spaces-1"
48+
PROJECT: "Another Project Name"
49+
RELEASE_NUMBER: "2.0.0"
50+
ENVIRONMENT: "Development"
51+
TENANT_TAGS:
52+
- "tagSetA/someTagB"
53+
- "tagSetC/someTagD"
54+
spec:
55+
arguments: |-
56+
{
57+
"definitions": {},
58+
"$schema": "http://json-schema.org/draft-07/schema#",
59+
"type": "object",
60+
"name": "octopusdeploy-deploy-release-tenanted",
61+
"additionalProperties": false,
62+
"patterns": [],
63+
"required": ["OCTOPUS_API_KEY", "OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "RELEASE_NUMBER", "ENVIRONMENT"],
64+
"properties": {
65+
"OCTOPUS_API_KEY": {
66+
"type": "string",
67+
"description": "API key for octopus deploy (required)"
68+
},
69+
"OCTOPUS_URL": {
70+
"type": "string",
71+
"description": "URL of the octopus deploy server (required)"
72+
},
73+
"OCTOPUS_SPACE": {
74+
"type": "string",
75+
"description": "API key for octopus deploy (required)"
76+
},
77+
"PROJECT": {
78+
"type": "string",
79+
"description": "The name of the project associated with this release (required)"
80+
},
81+
"RELEASE_NUMBER": {
82+
"type": "string",
83+
"description": "The release number to deploy (required)"
84+
},
85+
"ENVIRONMENT": {
86+
"type": "string",
87+
"description": "An environment name to deploy to (required)"
88+
},
89+
"TENANTS": {
90+
"type": "array",
91+
"items": {
92+
"type": "string"
93+
},
94+
"description": "The list of tenant names to deploy to (optional)"
95+
},
96+
"TENANT_TAGS": {
97+
"type": "array",
98+
"items": {
99+
"type": "string"
100+
},
101+
"description": "The list of tenant tag canonical names to locate tenants to deploy to. Format: Tag/Label (optional)"
102+
},
103+
"VARIABLES": {
104+
"type": "array",
105+
"items": {
106+
"type": "string"
107+
},
108+
"description": "Set the value for a prompted variable. Format: Label:Value (optional)"
109+
},
110+
"USE_GUIDED_FAILURE": {
111+
"type": "string",
112+
"description": "Whether to use guided failure mode if errors occur during the deployment. (optional)"
113+
}
114+
}
115+
}
116+
returns: |-
117+
{
118+
"definitions": {},
119+
"$schema": "http://json-schema.org/draft-07/schema#",
120+
"type": "object",
121+
"additionalProperties": true,
122+
"patterns": [],
123+
"required": [
124+
"DEPLOYMENTS"
125+
],
126+
"properties": {
127+
"DEPLOYMENTS": {
128+
"type": "array",
129+
"description": "The list of deployments",
130+
"items": {
131+
"type": "object",
132+
"additionalProperties": true,
133+
"patterns": [],
134+
"required": [
135+
"DeploymentId",
136+
"ServerTaskId"
137+
],
138+
"properties": {
139+
"DeploymentId": {
140+
"type": "string",
141+
"description": "The deployment Id"
142+
},
143+
"ServerTaskId": {
144+
"type": "string",
145+
"description": "The server task Id"
146+
}
147+
}
148+
}
149+
}
150+
}
151+
}
152+
stepsTemplate: |-
153+
deploy-release-tenanted:
154+
name: octopusdeploy-deploy-release-tenanted
155+
image: octopuslabs/octopus-cli
156+
environment:
157+
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
158+
- 'OCTOPUS_API_KEY=[[.Arguments.OCTOPUS_API_KEY]]'
159+
- 'OCTOPUS_SPACE=[[.Arguments.OCTOPUS_SPACE]]'
160+
commands:
161+
- OUTPUT=$(octopus release deploy
162+
--project "[[.Arguments.PROJECT]]"
163+
--version "[[.Arguments.RELEASE_NUMBER]]"
164+
--environment "[[.Arguments.ENVIRONMENT]]"
165+
--no-prompt
166+
--output-format json
167+
[[- range $val := .Arguments.TENANTS ]] --tenant "[[ $val ]]" [[ end ]]
168+
[[- range $val := .Arguments.TENANT_TAGS ]] --tenant-tag "[[ $val ]]" [[ end ]]
169+
[[- range $val := .Arguments.VARIABLES ]] --variable "[[ $val ]]" [[ end ]]
170+
[[- if .Arguments.USE_GUIDED_FAILURE ]] --guided-failure "[[ .Arguments.USE_GUIDED_FAILURE ]]" [[ end ]])
171+
- cf_export DEPLOYMENTS=$OUTPUT
172+
delimiters:
173+
left: "[["
174+
right: "]]"
Lines changed: 10 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)