From 60c4f0e745ace7d4c0fb7b1ca7a801224ac0d368 Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 17 Sep 2024 15:03:45 +1000 Subject: [PATCH 1/4] Deploy release in Octopus Deploy --- .../deploy-release.yml | 145 ++++++++++++++++++ .../deploy_release.svg | 10 ++ 2 files changed, 155 insertions(+) create mode 100644 incubating/octopusdeploy-deploy-release/deploy-release.yml create mode 100644 incubating/octopusdeploy-deploy-release/deploy_release.svg diff --git a/incubating/octopusdeploy-deploy-release/deploy-release.yml b/incubating/octopusdeploy-deploy-release/deploy-release.yml new file mode 100644 index 000000000..0a14dd68b --- /dev/null +++ b/incubating/octopusdeploy-deploy-release/deploy-release.yml @@ -0,0 +1,145 @@ +version: "1.0" +kind: step-type +metadata: + name: octopusdeploy-deploy-release + version: 1.0.0 + title: Deploy a release in Octopus Deploy + isPublic: true + description: Deploy a release in Octopus Deploy + sources: + - "https://github.com/codefresh-io/steps/tree/master/incubating/octopusdeploy-deploy-release" + stage: incubating + official: false + categories: + - deployment + icon: + type: svg + url: "https://cdn.jsdelivr.net/gh/codefresh-io/steps/incubating/octopusdeploy-deploy-release/deploy_release.svg" + background: "#152b3d" + maintainers: + - name: OctopusDeploy + examples: + - workflow: + deploy-release: + type: octopusdeploy/deploy-release + arguments: + OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}" + OCTOPUS_URL: "${{OCTOPUS_URL}}" + OCTOPUS_SPACE: "Spaces-1" + PROJECT: "Project Name" + RELEASE_NUMBER: "1.0.0" + ENVIRONMENTS: + - "Development" + - "Production" + VARIABLES: + - "prompted-variable1:prompted-value1" + - "prompted-variable2:prompted-value2" + USE_GUIDED_FAILURE: "false" +spec: + arguments: |- + { + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "name": "octopusdeploy-deploy-release", + "additionalProperties": false, + "patterns": [], + "required": ["OCTOPUS_API_KEY", "OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "RELEASE_NUMBER", "ENVIRONMENTS"], + "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)" + }, + "ENVIRONMENTS": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of environment names to deploy to (required)" + }, + "VARIABLES": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Set the value for a prompted variable in the format Label:Value (optional)" + }, + "USE_GUIDED_FAILURE": { + "type": "string", + "description": "A multi-line list of prompted variable values. Format: name:value (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: + name: octopusdeploy-deploy-release + 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]]" + --no-prompt + --output-format json + [[- range $val := .Arguments.ENVIRONMENTS ]] --environment "[[ $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: "]]" diff --git a/incubating/octopusdeploy-deploy-release/deploy_release.svg b/incubating/octopusdeploy-deploy-release/deploy_release.svg new file mode 100644 index 000000000..eb6de9079 --- /dev/null +++ b/incubating/octopusdeploy-deploy-release/deploy_release.svg @@ -0,0 +1,10 @@ + + + + + + + + + + From c709b964ebd05ce3685c27b2dbc129b6cc29be59 Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 17 Sep 2024 15:14:54 +1000 Subject: [PATCH 2/4] Make official and update type --- incubating/octopusdeploy-deploy-release/deploy-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/incubating/octopusdeploy-deploy-release/deploy-release.yml b/incubating/octopusdeploy-deploy-release/deploy-release.yml index 0a14dd68b..9304c2783 100644 --- a/incubating/octopusdeploy-deploy-release/deploy-release.yml +++ b/incubating/octopusdeploy-deploy-release/deploy-release.yml @@ -9,7 +9,7 @@ metadata: sources: - "https://github.com/codefresh-io/steps/tree/master/incubating/octopusdeploy-deploy-release" stage: incubating - official: false + official: true categories: - deployment icon: @@ -21,7 +21,7 @@ metadata: examples: - workflow: deploy-release: - type: octopusdeploy/deploy-release + type: octopusdeploy-deploy-release arguments: OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}" OCTOPUS_URL: "${{OCTOPUS_URL}}" From 4f3521897c264db9ad549272745e531123cc6b6e Mon Sep 17 00:00:00 2001 From: Shane Date: Wed, 18 Sep 2024 10:30:53 +1000 Subject: [PATCH 3/4] Rename to step.yaml --- .../{deploy-release.yml => step.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename incubating/octopusdeploy-deploy-release/{deploy-release.yml => step.yaml} (100%) diff --git a/incubating/octopusdeploy-deploy-release/deploy-release.yml b/incubating/octopusdeploy-deploy-release/step.yaml similarity index 100% rename from incubating/octopusdeploy-deploy-release/deploy-release.yml rename to incubating/octopusdeploy-deploy-release/step.yaml From e2a3f9c0ea55de4de1a037428e2a08c9a6e29a6e Mon Sep 17 00:00:00 2001 From: Shane Date: Thu, 19 Sep 2024 09:39:42 +1000 Subject: [PATCH 4/4] Update background color --- incubating/octopusdeploy-deploy-release/step.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubating/octopusdeploy-deploy-release/step.yaml b/incubating/octopusdeploy-deploy-release/step.yaml index 9304c2783..205e7fea4 100644 --- a/incubating/octopusdeploy-deploy-release/step.yaml +++ b/incubating/octopusdeploy-deploy-release/step.yaml @@ -15,7 +15,7 @@ metadata: icon: type: svg url: "https://cdn.jsdelivr.net/gh/codefresh-io/steps/incubating/octopusdeploy-deploy-release/deploy_release.svg" - background: "#152b3d" + background: "#F4F6F8" maintainers: - name: OctopusDeploy examples: