From a7b4122c23f0fcf8d9795ad681e74a6b91f45055 Mon Sep 17 00:00:00 2001 From: Chris Kim Date: Wed, 18 Sep 2024 17:50:34 +1200 Subject: [PATCH] Adds create package step --- .../create_package.svg | 9 ++ .../octopusdeploy-create-package/step.yaml | 123 ++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 incubating/octopusdeploy-create-package/create_package.svg create mode 100644 incubating/octopusdeploy-create-package/step.yaml diff --git a/incubating/octopusdeploy-create-package/create_package.svg b/incubating/octopusdeploy-create-package/create_package.svg new file mode 100644 index 000000000..eca5ce70b --- /dev/null +++ b/incubating/octopusdeploy-create-package/create_package.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/incubating/octopusdeploy-create-package/step.yaml b/incubating/octopusdeploy-create-package/step.yaml new file mode 100644 index 000000000..da5892d03 --- /dev/null +++ b/incubating/octopusdeploy-create-package/step.yaml @@ -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: "]]"