From 405f3213f2a07d6d3996356dd5000dc013200138 Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 17 Sep 2024 15:29:00 +1000 Subject: [PATCH 1/4] Deploy tenanted release in Octopus Deploy --- .../deploy-release-tenanted.svg | 10 + .../deploy-release-tenanted.yml | 174 ++++++++++++++++++ 2 files changed, 184 insertions(+) create mode 100644 incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.svg create mode 100644 incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.yml diff --git a/incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.svg b/incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.svg new file mode 100644 index 000000000..eb6de9079 --- /dev/null +++ b/incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.yml b/incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.yml new file mode 100644 index 000000000..2310c9432 --- /dev/null +++ b/incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.yml @@ -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://a.storyblok.com/f/92909/x/084296103a/logo-blue_140px_rgb.svg" # change later + background: "#0A375A" + 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: "]]" From f86ede224f6e356d76f4e520b32cc20fa74ea7c2 Mon Sep 17 00:00:00 2001 From: Shane Date: Wed, 18 Sep 2024 10:32:16 +1000 Subject: [PATCH 2/4] Rename to step.yaml --- .../{deploy-release-tenanted.yml => step.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename incubating/octopusdeploy-deploy-release-tenanted/{deploy-release-tenanted.yml => step.yaml} (100%) diff --git a/incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.yml b/incubating/octopusdeploy-deploy-release-tenanted/step.yaml similarity index 100% rename from incubating/octopusdeploy-deploy-release-tenanted/deploy-release-tenanted.yml rename to incubating/octopusdeploy-deploy-release-tenanted/step.yaml From fc2748fafc07b80b253712838b79ac8ace3af8a8 Mon Sep 17 00:00:00 2001 From: Shane Date: Wed, 18 Sep 2024 10:33:29 +1000 Subject: [PATCH 3/4] Update image location --- incubating/octopusdeploy-deploy-release-tenanted/step.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubating/octopusdeploy-deploy-release-tenanted/step.yaml b/incubating/octopusdeploy-deploy-release-tenanted/step.yaml index 2310c9432..baf9f33b3 100644 --- a/incubating/octopusdeploy-deploy-release-tenanted/step.yaml +++ b/incubating/octopusdeploy-deploy-release-tenanted/step.yaml @@ -14,7 +14,7 @@ metadata: - deployment icon: type: svg - url: "https://a.storyblok.com/f/92909/x/084296103a/logo-blue_140px_rgb.svg" # change later + url: "https://cdn.jsdelivr.net/gh/codefresh-io/steps/incubating/octopusdeploy-deploy-release/deploy-release-tenanted.svg" background: "#0A375A" maintainers: - name: OctopusDeploy From 62f0f06bb13ffcb293233d75fc99aa2bb4fbf26b Mon Sep 17 00:00:00 2001 From: Shane Date: Thu, 19 Sep 2024 09:40:10 +1000 Subject: [PATCH 4/4] Update background color --- incubating/octopusdeploy-deploy-release-tenanted/step.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubating/octopusdeploy-deploy-release-tenanted/step.yaml b/incubating/octopusdeploy-deploy-release-tenanted/step.yaml index baf9f33b3..ce7b059e1 100644 --- a/incubating/octopusdeploy-deploy-release-tenanted/step.yaml +++ b/incubating/octopusdeploy-deploy-release-tenanted/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-tenanted.svg" - background: "#0A375A" + background: "#F4F6F8" maintainers: - name: OctopusDeploy examples: