Skip to content

Commit dc12c88

Browse files
Merge branch 'master' into CR-25021
2 parents b9bd8cf + 9645dea commit dc12c88

File tree

15 files changed

+1052
-5
lines changed

15 files changed

+1052
-5
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.1
6+
title: Create Octopus Deploy 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: 4 additions & 0 deletions
Loading
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
version: "1.0"
2+
kind: step-type
3+
metadata:
4+
name: octopusdeploy-create-release
5+
version: 1.0.0
6+
title: Create a release in Octopus Deploy
7+
isPublic: true
8+
description: Create a release in Octopus Deploy
9+
sources:
10+
- "https://github.com/codefresh-io/steps/tree/master/incubating/octopusdeploy-create-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-create-release/create_release.svg"
18+
background: "#F4F6F8"
19+
maintainers:
20+
- name: OctopusDeploy
21+
examples:
22+
- description: Basic usage of the create release step
23+
workflow:
24+
create-release:
25+
type: octopusdeploy-create-release
26+
arguments:
27+
OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}"
28+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
29+
OCTOPUS_SPACE: "Spaces 1"
30+
PROJECT: "Project Name"
31+
- description: Complex usage of the create release step
32+
workflow:
33+
create-release:
34+
type: octopusdeploy-create-release
35+
arguments:
36+
OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}"
37+
OCTOPUS_URL: "${{OCTOPUS_URL}}"
38+
OCTOPUS_SPACE: "Spaces 1"
39+
PROJECT: "Project Name"
40+
RELEASE_NUMBER: "1.0.0"
41+
CHANNEL: "Channel Name"
42+
GIT_REF: "refs/heads/main"
43+
GIT_COMMIT: "Commit ID"
44+
PACKAGE_VERSION: "1.0.0"
45+
PACKAGES:
46+
- "Package:1.0.0"
47+
RELEASE_NOTES: "This is a release note"
48+
RELEASE_NOTES_FILE: "/release-notes.txt"
49+
IGNORE_EXISTING: false
50+
spec:
51+
arguments: |-
52+
{
53+
"definitions": {},
54+
"$schema": "http://json-schema.org/draft-07/schema#",
55+
"type": "object",
56+
"name": "octopusdeploy-create-release",
57+
"additionalProperties": false,
58+
"patterns": [],
59+
"required": ["OCTOPUS_API_KEY", "OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT"],
60+
"properties": {
61+
"OCTOPUS_API_KEY": {
62+
"type": "string",
63+
"description": "API key for octopus deploy (required)"
64+
},
65+
"OCTOPUS_URL": {
66+
"type": "string",
67+
"description": "URL of the octopus deploy server (required)"
68+
},
69+
"OCTOPUS_SPACE": {
70+
"type": "string",
71+
"description": "API key for octopus deploy (required)"
72+
},
73+
"PROJECT": {
74+
"type": "string",
75+
"description": "The name of the project associated with this release (required)"
76+
},
77+
"RELEASE_NUMBER": {
78+
"type": "string",
79+
"description": "The release number to create (optional)"
80+
},
81+
"CHANNEL": {
82+
"type": "string",
83+
"description": "Name or ID of the channel to use"
84+
},
85+
"GIT_REF": {
86+
"type": "string",
87+
"description": "Git Reference e.g. refs/heads/main. Only relevant for config-as-code projects"
88+
},
89+
"GIT_COMMIT": {
90+
"type": "string",
91+
"description": "Git Commit Hash; Specify this in addition to Git Reference if you want to reference a commit other than the latest for that branch/tag."
92+
},
93+
"PACKAGE_VERSION": {
94+
"type": "string",
95+
"description": "Default version to use for all Packages"
96+
},
97+
"PACKAGES": {
98+
"type": "array",
99+
"description": "Version specification a specific packages. Format as {package}:{version}, {step}:{version} or {package-ref-name}:{packageOrStep}:{version}"
100+
},
101+
"RELEASE_NOTES": {
102+
"type": "string",
103+
"description": "Release notes to attach"
104+
},
105+
"RELEASE_NOTES_FILE": {
106+
"type": "string",
107+
"description": " Release notes to attach (from file)"
108+
},
109+
"IGNORE_EXISTING": {
110+
"type": "boolean",
111+
"description": "If a release with the same version exists, do nothing instead of failing."
112+
}
113+
}
114+
}
115+
returns: |-
116+
{
117+
"definitions": {},
118+
"$schema": "http://json-schema.org/draft-07/schema#",
119+
"type": "object",
120+
"patterns": [],
121+
"required": [
122+
"RELEASE"
123+
],
124+
"properties": {
125+
"RELEASE": {
126+
"type": "string",
127+
"description": "The release version that was created"
128+
}
129+
}
130+
}
131+
stepsTemplate: |-
132+
create-release:
133+
name: octopusdeploy-create-release
134+
image: octopuslabs/octopus-cli
135+
tag: latest
136+
commands:
137+
- OUTPUT=$(octopus release create
138+
--project "[[.Arguments.PROJECT]]"
139+
--no-prompt
140+
--output-format basic
141+
[[- if .Arguments.PACKAGE_VERSION ]] --package-version "[[ .Arguments.PACKAGE_VERSION ]]" [[ end ]]
142+
[[- range $val := .Arguments.PACKAGES ]] --package "[[ $val ]]" [[ end ]]
143+
[[- if .Arguments.RELEASE_NUMBER ]] --version "[[ .Arguments.RELEASE_NUMBER ]]" [[ end ]]
144+
[[- if .Arguments.CHANNEL ]] --channel "[[ .Arguments.CHANNEL ]]" [[ end ]]
145+
[[- if .Arguments.GIT_REF ]] --git-ref "[[ .Arguments.GIT_REF ]]" [[ end ]]
146+
[[- if .Arguments.GIT_COMMIT ]] --git-commit "[[ .Arguments.GIT_COMMIT ]]" [[ end ]]
147+
[[- if .Arguments.RELEASE_NOTES ]] --release-notes "[[ .Arguments.RELEASE_NOTES ]]" [[ end ]]
148+
[[- if .Arguments.RELEASE_NOTES_FILE ]] --release-notes-file "[[ .Arguments.RELEASE_NOTES_FILE ]]" [[ end ]]
149+
[[- if .Arguments.IGNORE_EXISTING ]] --ignore-existing [[ end ]])
150+
- cf_export RELEASE=$OUTPUT
151+
environment:
152+
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]'
153+
- 'OCTOPUS_API_KEY=[[.Arguments.OCTOPUS_API_KEY]]'
154+
- 'OCTOPUS_SPACE=[[.Arguments.OCTOPUS_SPACE]]'
155+
delimiters:
156+
left: "[["
157+
right: "]]"
Lines changed: 10 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)