Skip to content

Commit 1a6c1e2

Browse files
mik-kybec-callow-octtothegills
authored
Adds create package step for Octopus Deploy (#707)
* Adds create package step * Change output format to string --------- Co-authored-by: Bec Callow <bec.callow@octopus.com> Co-authored-by: Shane Gill <tothegills@users.noreply.github.com>
1 parent c8e5355 commit 1a6c1e2

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-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: "]]"

0 commit comments

Comments
 (0)