Skip to content

Commit

Permalink
Adds create package step
Browse files Browse the repository at this point in the history
  • Loading branch information
mik-ky committed Sep 18, 2024
1 parent 1649290 commit a7b4122
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 0 deletions.
9 changes: 9 additions & 0 deletions incubating/octopusdeploy-create-package/create_package.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 123 additions & 0 deletions incubating/octopusdeploy-create-package/step.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
version: "1.0"
kind: step-type
metadata:
name: octopusdeploy-create-package
version: 1.0.0
title: Create a package
isPublic: true
description: Creates a zip package in the format expected by Octopus Deploy
sources:
- "https://github.com/codefresh-io/steps/tree/master/incubating/octopusdeploy-create-package"
stage: incubating
official: true
categories:
- utility
icon:
type: svg
url: "https://cdn.jsdelivr.net/gh/codefresh-io/steps/incubating/octopusdeploy-create-package/create_package.svg"
background: "#F4F6F8"
maintainers:
- name: OctopusDeploy
examples:
- description: Package the current working directory
workflow:
create-package:
type: octopusdeploy-create-package
arguments:
ID: "SomePackage"
VERSION: "1.0.0"
- description: Complex usage
workflow:
create-package:
type: octopusdeploy-create-package
arguments:
ID: "SomePackage"
VERSION: "1.0.0"
BASE_PATH: "/codefresh/volume"
OUT_FOLDER: "/codefresh/volume"
INCLUDE:
- "*.html"
- "*.css"
spec:
arguments: |-
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"name": "octopusdeploy-create-package",
"additionalProperties": false,
"patterns": [],
"required": ["ID", "VERSION"],
"properties": {
"ID": {
"type": "string",
"description": "The ID of the package. (required)"
},
"VERSION": {
"type": "string",
"description": "The version of the package, must be a valid SemVer. (required)"
},
"BASE_PATH": {
"type": "string",
"description": "Root folder containing the contents to zip. (optional)"
},
"OUT_FOLDER": {
"type": "string",
"description": "Folder into which the zip file will be written. (optional)"
},
"INCLUDE": {
"type": "array",
"items": {
"type": "string"
},
"description": "Add a file pattern to include, relative to the base path e.g. /bin/*.dll; defaults to '**'. (optional)"
},
"OVERWRITE": {
"type": "boolean",
"description": "Allow an existing package file of the same ID/version to be overwritten. (optional)"
}
}
}
returns: |-
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": true,
"patterns": [],
"required": [
"FILE"
],
"properties": {
"FILE": {
"additionalProperties": true,
"type": "object",
"description": "The zip file that was created",
"properties": {
"Path": {
"type": "string",
"description": "The path to the zip file"
}
}
}
}
}
stepsTemplate: |-
create-package:
name: octopusdeploy-create-package
image: octopuslabs/octopus-cli
tag: latest
commands:
- OUTPUT=$(octopus package zip create
--id "[[ .Arguments.ID ]]"
--version "[[ .Arguments.VERSION ]]"
[[- if .Arguments.BASE_PATH ]] --base-path "[[ .Arguments.BASE_PATH ]]" [[ end ]]
[[- if .Arguments.OUT_FOLDER ]] --out-folder "[[ .Arguments.OUT_FOLDER ]]" [[ end ]]
[[- range $val := .Arguments.INCLUDE ]] --include "[[ $val ]]" [[ end ]]
[[- if .Arguments.OVERWRITE ]] --overwrite [[ end ]]
--output-format json
--no-prompt)
- cf_export FILE=$OUTPUT
delimiters:
left: "[["
right: "]]"

0 comments on commit a7b4122

Please sign in to comment.