|
| 1 | +version: "1.0" |
| 2 | +kind: step-type |
| 3 | +metadata: |
| 4 | + name: octopusdeploy-deploy-release-tenanted |
| 5 | + version: 1.0.0 |
| 6 | + title: Deploy a tenanted release in Octopus Deploy |
| 7 | + isPublic: true |
| 8 | + description: Deploy a tenanted release in Octopus Deploy |
| 9 | + sources: |
| 10 | + - "https://github.com/codefresh-io/steps/tree/master/incubating/octopusdeploy-deploy-release-tenanted" |
| 11 | + stage: incubating |
| 12 | + official: true |
| 13 | + categories: |
| 14 | + - deployment |
| 15 | + icon: |
| 16 | + type: svg |
| 17 | + url: "https://cdn.jsdelivr.net/gh/codefresh-io/steps/incubating/octopusdeploy-deploy-release/deploy-release-tenanted.svg" |
| 18 | + background: "#F4F6F8" |
| 19 | + maintainers: |
| 20 | + - name: OctopusDeploy |
| 21 | + examples: |
| 22 | + - description: "Deploy using tenant name" |
| 23 | + workflow: |
| 24 | + deploy-release-tenanted: |
| 25 | + type: octopusdeploy-deploy-release-tenanted |
| 26 | + arguments: |
| 27 | + OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}" |
| 28 | + OCTOPUS_URL: "${{OCTOPUS_URL}}" |
| 29 | + OCTOPUS_SPACE: "Spaces-1" |
| 30 | + PROJECT: "Project Name" |
| 31 | + RELEASE_NUMBER: "1.0.0" |
| 32 | + ENVIRONMENT: "Production" |
| 33 | + TENANTS: |
| 34 | + - "Tenant1" |
| 35 | + - "Tenant2" |
| 36 | + VARIABLES: |
| 37 | + - "prompted-variable1:prompted-value1" |
| 38 | + - "prompted-variable2:prompted-value2" |
| 39 | + USE_GUIDED_FAILURE: "false" |
| 40 | + - description: "Deploy using tenant tags" |
| 41 | + workflow: |
| 42 | + deploy-release-tenanted: |
| 43 | + type: octopusdeploy-deploy-release-tenanted |
| 44 | + arguments: |
| 45 | + OCTOPUS_API_KEY: "${{OCTOPUS_API_KEY}}" |
| 46 | + OCTOPUS_URL: "${{OCTOPUS_URL}}" |
| 47 | + OCTOPUS_SPACE: "Spaces-1" |
| 48 | + PROJECT: "Another Project Name" |
| 49 | + RELEASE_NUMBER: "2.0.0" |
| 50 | + ENVIRONMENT: "Development" |
| 51 | + TENANT_TAGS: |
| 52 | + - "tagSetA/someTagB" |
| 53 | + - "tagSetC/someTagD" |
| 54 | +spec: |
| 55 | + arguments: |- |
| 56 | + { |
| 57 | + "definitions": {}, |
| 58 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 59 | + "type": "object", |
| 60 | + "name": "octopusdeploy-deploy-release-tenanted", |
| 61 | + "additionalProperties": false, |
| 62 | + "patterns": [], |
| 63 | + "required": ["OCTOPUS_API_KEY", "OCTOPUS_URL", "OCTOPUS_SPACE", "PROJECT", "RELEASE_NUMBER", "ENVIRONMENT"], |
| 64 | + "properties": { |
| 65 | + "OCTOPUS_API_KEY": { |
| 66 | + "type": "string", |
| 67 | + "description": "API key for octopus deploy (required)" |
| 68 | + }, |
| 69 | + "OCTOPUS_URL": { |
| 70 | + "type": "string", |
| 71 | + "description": "URL of the octopus deploy server (required)" |
| 72 | + }, |
| 73 | + "OCTOPUS_SPACE": { |
| 74 | + "type": "string", |
| 75 | + "description": "API key for octopus deploy (required)" |
| 76 | + }, |
| 77 | + "PROJECT": { |
| 78 | + "type": "string", |
| 79 | + "description": "The name of the project associated with this release (required)" |
| 80 | + }, |
| 81 | + "RELEASE_NUMBER": { |
| 82 | + "type": "string", |
| 83 | + "description": "The release number to deploy (required)" |
| 84 | + }, |
| 85 | + "ENVIRONMENT": { |
| 86 | + "type": "string", |
| 87 | + "description": "An environment name to deploy to (required)" |
| 88 | + }, |
| 89 | + "TENANTS": { |
| 90 | + "type": "array", |
| 91 | + "items": { |
| 92 | + "type": "string" |
| 93 | + }, |
| 94 | + "description": "The list of tenant names to deploy to (optional)" |
| 95 | + }, |
| 96 | + "TENANT_TAGS": { |
| 97 | + "type": "array", |
| 98 | + "items": { |
| 99 | + "type": "string" |
| 100 | + }, |
| 101 | + "description": "The list of tenant tag canonical names to locate tenants to deploy to. Format: Tag/Label (optional)" |
| 102 | + }, |
| 103 | + "VARIABLES": { |
| 104 | + "type": "array", |
| 105 | + "items": { |
| 106 | + "type": "string" |
| 107 | + }, |
| 108 | + "description": "Set the value for a prompted variable. Format: Label:Value (optional)" |
| 109 | + }, |
| 110 | + "USE_GUIDED_FAILURE": { |
| 111 | + "type": "string", |
| 112 | + "description": "Whether to use guided failure mode if errors occur during the deployment. (optional)" |
| 113 | + } |
| 114 | + } |
| 115 | + } |
| 116 | + returns: |- |
| 117 | + { |
| 118 | + "definitions": {}, |
| 119 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 120 | + "type": "object", |
| 121 | + "additionalProperties": true, |
| 122 | + "patterns": [], |
| 123 | + "required": [ |
| 124 | + "DEPLOYMENTS" |
| 125 | + ], |
| 126 | + "properties": { |
| 127 | + "DEPLOYMENTS": { |
| 128 | + "type": "array", |
| 129 | + "description": "The list of deployments", |
| 130 | + "items": { |
| 131 | + "type": "object", |
| 132 | + "additionalProperties": true, |
| 133 | + "patterns": [], |
| 134 | + "required": [ |
| 135 | + "DeploymentId", |
| 136 | + "ServerTaskId" |
| 137 | + ], |
| 138 | + "properties": { |
| 139 | + "DeploymentId": { |
| 140 | + "type": "string", |
| 141 | + "description": "The deployment Id" |
| 142 | + }, |
| 143 | + "ServerTaskId": { |
| 144 | + "type": "string", |
| 145 | + "description": "The server task Id" |
| 146 | + } |
| 147 | + } |
| 148 | + } |
| 149 | + } |
| 150 | + } |
| 151 | + } |
| 152 | + stepsTemplate: |- |
| 153 | + deploy-release-tenanted: |
| 154 | + name: octopusdeploy-deploy-release-tenanted |
| 155 | + image: octopuslabs/octopus-cli |
| 156 | + environment: |
| 157 | + - 'OCTOPUS_URL=[[.Arguments.OCTOPUS_URL]]' |
| 158 | + - 'OCTOPUS_API_KEY=[[.Arguments.OCTOPUS_API_KEY]]' |
| 159 | + - 'OCTOPUS_SPACE=[[.Arguments.OCTOPUS_SPACE]]' |
| 160 | + commands: |
| 161 | + - OUTPUT=$(octopus release deploy |
| 162 | + --project "[[.Arguments.PROJECT]]" |
| 163 | + --version "[[.Arguments.RELEASE_NUMBER]]" |
| 164 | + --environment "[[.Arguments.ENVIRONMENT]]" |
| 165 | + --no-prompt |
| 166 | + --output-format json |
| 167 | + [[- range $val := .Arguments.TENANTS ]] --tenant "[[ $val ]]" [[ end ]] |
| 168 | + [[- range $val := .Arguments.TENANT_TAGS ]] --tenant-tag "[[ $val ]]" [[ end ]] |
| 169 | + [[- range $val := .Arguments.VARIABLES ]] --variable "[[ $val ]]" [[ end ]] |
| 170 | + [[- if .Arguments.USE_GUIDED_FAILURE ]] --guided-failure "[[ .Arguments.USE_GUIDED_FAILURE ]]" [[ end ]]) |
| 171 | + - cf_export DEPLOYMENTS=$OUTPUT |
| 172 | + delimiters: |
| 173 | + left: "[[" |
| 174 | + right: "]]" |
0 commit comments