|
| 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 | + "additionalProperties": true, |
| 87 | + "patterns": [], |
| 88 | + "required": [ |
| 89 | + "FILE" |
| 90 | + ], |
| 91 | + "properties": { |
| 92 | + "FILE": { |
| 93 | + "additionalProperties": true, |
| 94 | + "type": "object", |
| 95 | + "description": "The zip file that was created", |
| 96 | + "properties": { |
| 97 | + "Path": { |
| 98 | + "type": "string", |
| 99 | + "description": "The path to the zip file" |
| 100 | + } |
| 101 | + } |
| 102 | + } |
| 103 | + } |
| 104 | + } |
| 105 | + stepsTemplate: |- |
| 106 | + create-package: |
| 107 | + name: octopusdeploy-create-package |
| 108 | + image: octopuslabs/octopus-cli |
| 109 | + tag: latest |
| 110 | + commands: |
| 111 | + - OUTPUT=$(octopus package zip create |
| 112 | + --id "[[ .Arguments.ID ]]" |
| 113 | + --version "[[ .Arguments.VERSION ]]" |
| 114 | + [[- if .Arguments.BASE_PATH ]] --base-path "[[ .Arguments.BASE_PATH ]]" [[ end ]] |
| 115 | + [[- if .Arguments.OUT_FOLDER ]] --out-folder "[[ .Arguments.OUT_FOLDER ]]" [[ end ]] |
| 116 | + [[- range $val := .Arguments.INCLUDE ]] --include "[[ $val ]]" [[ end ]] |
| 117 | + [[- if .Arguments.OVERWRITE ]] --overwrite [[ end ]] |
| 118 | + --output-format json |
| 119 | + --no-prompt) |
| 120 | + - cf_export FILE=$OUTPUT |
| 121 | + delimiters: |
| 122 | + left: "[[" |
| 123 | + right: "]]" |
0 commit comments