The CloudBees CD/RO third-party deployment feature allows you to perform deployments using your own deployment tools and still enjoy the benefits of CloudBees CD/RO application modeling. CloudBees CD/RO simplified the process for using third-party tools for deployment by introducing Deploy and Undeploy options in pipeline tasks. If application and/or component versions are included in the task definition, environment inventory, path to production, and deployment analytics data will be updated with these values when the task runs.
With this approach, CloudBees CD/RO delegates deployment to the third-party tool and CloudBees CD/RO uses the version values directly without knowledge of what the third party tool actually does. In principle, the version values can be passed to the third party tool to direct its actions. This requires additional configuration. It is also possible to update environment inventory, path to production, and analytics based on the response from the third party deployment tool.
To demonstrate CloudBees CD/RO third-party deployments via a plugin, a demo plugin is available in the CloudBees community plugins that implements the Deploy and Undeploy options. For more information on this demo plugin, refer to the BringYourOwnDeployerPlugin. |
Create a deployment task that triggers a third-party tool to perform a deployment
The following steps create a deployment task definition. As part of the definition, you must specify the name and project name for an external application and environment. The external application and environment are used to associate inventory and analytics data. When the task is run, if the application or environment do not exist, the application and environment models are created, and the versions supplied are used to update the inventory. The new external application and environment are used to associate inventory and analytics data. When the task is run, the application and environment models will be created and the versions supplied will be used to update the inventory.
-
Navigate to the release or pipeline that you want to add a deployment task using a third-party tool.
-
Select Add Task from the stage’s three-dots menu.
-
Enter a task identifier in the New Task field, then click Select Task Type. The Task Type dialog displays.
-
Select one of the following task types:
-
CI Job
-
Procedure
-
Command
-
Plugin
-
-
Select or enter the required details for the selected task type.
-
Select Deploy task.
-
Select the project for the external application.
-
Select or add the external application name.
Third-party applications shown or created here are assigned the External
application type. -
Select or add an environment name.
-
Enter the application and/or artifact versions.
To use multiple property references: Enter as a single, comma separated, expression. Example:
[art1.1.2,art2.5.5,art2.6.1]
To use a composite string constructed from multiple properties: Use
/javascript
format. Example: Two pipeline input parameters,v1
andv2
.$[/javascript "art1:$[v1],art2:$[v2]"]
. -
Configure a task hook command or procedure to execute as the last step of the task. Example: log processing or extracting third-party tool data.
-
Configure a task hook command.
-
Select the Command as the Post execution option.
-
Enter
ec-groovy
in the Shell field. -
Enter shell command in groovy format. Refer to Task Hook examples for a sample command.
-
-
Configure a task hook procedure.
-
Select the Procedure as the Post execution option.
-
Select the project name from the menu or enter a new one.
-
Select the name of an existing hook procedure or enter the name of a new procedure.
-
Define hook procedure parameters. Refer to Task Hook examples for the sample hook procedure.
-
-
-
Select Save changes.
Create a deployment task that triggers a third-party tool to perform an undeployment
-
Create a pipeline task of the following type.
Only the pipeline task types below support undeploy as a sub-task type: -
Plugin procedure
-
Project procedure
-
CI job
-
Command
-
-
Flag the task to indicate that it is an undeploy task.
-
Enter the application, environment, and version details.
Use the third party deployment response for inventory and analytics updates
Upon successful completion of the Deploy sub-task type, if the ec_deployment_artifacts
property exists for the job, the CloudBees CD/RO server reads the properties to update the inventory and sends the deployment data to the CloudBees Analytics server.
The property value should be in the following JSON format:
IPv6 addresses are only supported for Kubernetes platforms. If using an IPv6 address, enclose the address in square brackets. Example: [<IPv6-ADDRESS>] .
|
{ "deploymentSystem": "name of the 3rd-party tool", "deploymentUrl": "URL for this deployment job in the 3rd-party tool", "applicationVersion": "your-applicationVersion-optional", "artifacts": [ { "artifactName": "your-artifactName-1-required", "artifactVersion": "your-artifactVersion-1-required", "artifactUrl": "your-artifactUrl-1-optional", "additionalDetails": { "deploymentTargets": "deploymentTarget-1-optional, deploymentTarget-2-optional", "detail1": "value1", "detail2": "value2" } }, { "artifactName": "your-artifactName-2-required", "artifactVersion": "your-artifactVersion-2-required", "artifactUrl": "your-artifactUrl-2-optional", "additionalDetails": { "deploymentTargets": "deploymentTarget-3-optional, deploymentTarget-4-optional", "detail1": "value1", "detail2": "value2" } } ] }
The example at Third party deploy parse response illustrates how to accomplish this.