-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fnm/create-release-step
- Loading branch information
Showing
8 changed files
with
656 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
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", | ||
"patterns": [], | ||
"required": [ | ||
"PATH" | ||
], | ||
"properties": { | ||
"PATH": { | ||
"type": "string", | ||
"description": "The zip file path that was created" | ||
} | ||
} | ||
} | ||
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 basic | ||
--no-prompt) | ||
- cf_export PATH="$OUTPUT" | ||
delimiters: | ||
left: "[[" | ||
right: "]]" |
10 changes: 10 additions & 0 deletions
10
incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
174 changes: 174 additions & 0 deletions
174
incubating/octopusdeploy-deploy-release-tenanted/step.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
version: "1.0" | ||
kind: step-type | ||
metadata: | ||
name: octopusdeploy-deploy-release-tenanted | ||
version: 1.0.0 | ||
title: Deploy a tenanted release in Octopus Deploy | ||
isPublic: true | ||
description: Deploy a tenanted release in Octopus Deploy | ||
sources: | ||
- "https://github.com/codefresh-io/steps/tree/master/incubating/octopusdeploy-deploy-release-tenanted" | ||
stage: incubating | ||
official: true | ||
categories: | ||
- deployment | ||
icon: | ||
type: svg | ||
url: "https://cdn.jsdelivr.net/gh/codefresh-io/steps/incubating/octopusdeploy-deploy-release/deploy-release-tenanted.svg" | ||
background: "#F4F6F8" | ||
maintainers: | ||
- name: OctopusDeploy | ||
examples: | ||
- description: "Deploy using tenant name" | ||
workflow: | ||
deploy-release-tenanted: | ||
type: octopusdeploy-deploy-release-tenanted | ||
arguments: | ||
OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}" | ||
OCTOPUS_URL: "${{OCTOPUS_URL}}" | ||
OCTOPUS_SPACE: "Spaces-1" | ||
PROJECT: "Project Name" | ||
RELEASE_NUMBER: "1.0.0" | ||
ENVIRONMENT: "Production" | ||
TENANTS: | ||
- "Tenant1" | ||
- "Tenant2" | ||
VARIABLES: | ||
- "prompted-variable1:prompted-value1" | ||
- "prompted-variable2:prompted-value2" | ||
USE_GUIDED_FAILURE: "false" | ||
- description: "Deploy using tenant tags" | ||
workflow: | ||
deploy-release-tenanted: | ||
type: octopusdeploy-deploy-release-tenanted | ||
arguments: | ||
OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}" | ||
OCTOPUS_URL: "${{OCTOPUS_URL}}" | ||
OCTOPUS_SPACE: "Spaces-1" | ||
PROJECT: "Another Project Name" | ||
RELEASE_NUMBER: "2.0.0" | ||
ENVIRONMENT: "Development" | ||
TENANT_TAGS: | ||
- "tagSetA/someTagB" | ||
- "tagSetC/someTagD" | ||
spec: | ||
arguments: |- | ||
{ | ||
"definitions": {}, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"name": "octopusdeploy-deploy-release-tenanted", | ||
"additionalProperties": false, | ||
"patterns": [], | ||
"required": ["OCTOPUS_API_KEY", "OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "RELEASE_NUMBER", "ENVIRONMENT"], | ||
"properties": { | ||
"OCTOPUS_API_KEY": { | ||
"type": "string", | ||
"description": "API key for octopus deploy (required)" | ||
}, | ||
"OCTOPUS_URL": { | ||
"type": "string", | ||
"description": "URL of the octopus deploy server (required)" | ||
}, | ||
"OCTOPUS_SPACE": { | ||
"type": "string", | ||
"description": "API key for octopus deploy (required)" | ||
}, | ||
"PROJECT": { | ||
"type": "string", | ||
"description": "The name of the project associated with this release (required)" | ||
}, | ||
"RELEASE_NUMBER": { | ||
"type": "string", | ||
"description": "The release number to deploy (required)" | ||
}, | ||
"ENVIRONMENT": { | ||
"type": "string", | ||
"description": "An environment name to deploy to (required)" | ||
}, | ||
"TENANTS": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "The list of tenant names to deploy to (optional)" | ||
}, | ||
"TENANT_TAGS": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "The list of tenant tag canonical names to locate tenants to deploy to. Format: Tag/Label (optional)" | ||
}, | ||
"VARIABLES": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "Set the value for a prompted variable. Format: Label:Value (optional)" | ||
}, | ||
"USE_GUIDED_FAILURE": { | ||
"type": "string", | ||
"description": "Whether to use guided failure mode if errors occur during the deployment. (optional)" | ||
} | ||
} | ||
} | ||
returns: |- | ||
{ | ||
"definitions": {}, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"additionalProperties": true, | ||
"patterns": [], | ||
"required": [ | ||
"DEPLOYMENTS" | ||
], | ||
"properties": { | ||
"DEPLOYMENTS": { | ||
"type": "array", | ||
"description": "The list of deployments", | ||
"items": { | ||
"type": "object", | ||
"additionalProperties": true, | ||
"patterns": [], | ||
"required": [ | ||
"DeploymentId", | ||
"ServerTaskId" | ||
], | ||
"properties": { | ||
"DeploymentId": { | ||
"type": "string", | ||
"description": "The deployment Id" | ||
}, | ||
"ServerTaskId": { | ||
"type": "string", | ||
"description": "The server task Id" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stepsTemplate: |- | ||
deploy-release-tenanted: | ||
name: octopusdeploy-deploy-release-tenanted | ||
image: octopuslabs/octopus-cli | ||
environment: | ||
- 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]' | ||
- 'OCTOPUS_API_KEY=[[.Arguments.OCTOPUS_API_KEY]]' | ||
- 'OCTOPUS_SPACE=[[.Arguments.OCTOPUS_SPACE]]' | ||
commands: | ||
- OUTPUT=$(octopus release deploy | ||
--project "[[.Arguments.PROJECT]]" | ||
--version "[[.Arguments.RELEASE_NUMBER]]" | ||
--environment "[[.Arguments.ENVIRONMENT]]" | ||
--no-prompt | ||
--output-format json | ||
[[- range $val := .Arguments.TENANTS ]] --tenant "[[ $val ]]" [[ end ]] | ||
[[- range $val := .Arguments.TENANT_TAGS ]] --tenant-tag "[[ $val ]]" [[ end ]] | ||
[[- range $val := .Arguments.VARIABLES ]] --variable "[[ $val ]]" [[ end ]] | ||
[[- if .Arguments.USE_GUIDED_FAILURE ]] --guided-failure "[[ .Arguments.USE_GUIDED_FAILURE ]]" [[ end ]]) | ||
- cf_export DEPLOYMENTS=$OUTPUT | ||
delimiters: | ||
left: "[[" | ||
right: "]]" |
10 changes: 10 additions & 0 deletions
10
incubating/octopusdeploy-deploy-release/deploy_release.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.