CloudBees Continuous Deployment and Release Orchestration (CD/RO), formerly CloudBees CD, is an enterprise-grade DevOps release automation platform that simplifies provisioning, building, and releasing multi-tiered applications. Our model-driven approach for managing environments and applications allows teams to collaborate and coordinate across multiple pipelines and releases within hybrid infrastructures in an efficient, predictable, and auditable way.
The CloudBees CD plugin allows you to integrate CloudBees CD/RO features and APIs directly in your Jenkins instances. From running pipelines that compile your applications to deploying them, the CloudBees CD plugin helps reduce the inherent complexity of continuous deployment and release orchestration. For more information on the capabilities of this plugin, refer to Plugin features.
Starting with CloudBees CD/RO v2023.02.0, you must upgrade to CloudBees CD plugin v1.1.30 or later. Failure to do so will result in failed plugin procedures. Plugin versions v1.1.30 or later are backwards compatible with previous CloudBees CD/RO releases.
The CloudBees CD plugin integrates the following features into your Jenkins instances to interact with CloudBees CD/RO:
- Connect to your CloudBees CD server
- Call CloudBees CD REST APIs
- Create applications from deployment packages
- Deploy applications
- Publish artifacts
- Run pipelines
- Run procedures
- Trigger releases
To use and integrate with CloudBees CD/RO, you must create a connection configuration in Jenkins to store your CloudBees CD/RO server information. Depending on the number of servers or environments you are integrating, you can create one or multiple connection configurations to connect with and call CloudBees CD/RO APIs.
To create and configure your connection:
-
Login into your Jenkins instance and navigate to Manage Jenkins > Configure System.
-
Under Configurations, find the CloudBees CD section and select Add.
-
Specify the following information for your configuration:
-
Configuration Name: Name for this configuration.
-
Server URL: Your CloudBees CD/RO server URL.
-
REST API Version: CloudBees CD/RO server REST API version.
-
-
Select Save in the Jenkins UI to confirm your configuration.
-
If you are redirected to another page, navigate back to Manage Jenkins > Configure System, and under CloudBees CD > Configurations, find the configuration you just created.
-
Add your Credentials Type:
-
Username and Password: CloudBees CD/RO username and password for your connection.
-
Stored Credential: Used to configure authentication via stored credentials, which can be a username/password or secret text that supports an SSO session ID token.
TIP: To configure a connection using an SSO session ID token, refer to Configuring an SSO session ID token for CloudBees CD.
-
-
Both Do not send build details to CloudBees CD and Override CloudBees CD SSL Validation Check are optional settings. You can select their ? icons and read the descriptions to decide if you want to use these features.
-
Select Test Connection to ensure your credential is working correctly. If you receive a
Success
message, your configuration is ready to use. If you receive an error code, ensure your Server URL is correct. If it is, typically there was an error in the credential configuration and the configuration should be reconfigured.
The CloudBees CD plugin allows you to authenticate actions using an SSO session ID token. Before starting:
- You must have a generated CloudBees SSO session ID token. If you have not generated a CloudBees SSO session ID token, refer to Generate an SSO session ID token for help.
- You must have already set up a CloudBees CD configuration and saved it to Jenkins. If not, follow the steps in Connecting to your CloudBees CD server until Credentials Type.
The following steps describe how to configure a CloudBees SSO session ID token within a CloudBees CD configuration.
- Navigate to Manage Jenkins > Configure System. Under CloudBees CD > Configurations, find the configuration to which you want to add an SSO session ID token.
- Under Credentials Type, select Stored Credential. A new entry field opens.
- For Stored Credential, select Add and Jenkins. A new window opens for the Jenkins Credential Provider.
- By default, the Domain field is set to Global credentials (unrestricted) and is unchangeable.
- For Kind, select Secret text.
- Select the Scope you want to use your token for.
- In the Secret field, enter your CloudBees SSO session ID token.
- The ID field is optional. If you want to provide an ID, select the ? icon and read the message to ensure you understand the purpose and requirements of this field.
- The Description field is optional. However, it is suggested to provide one to help you keep track of the token configuration in your Credentials profile.
NOTE: Ensure the information for your credential is correct before moving to the next step. If your credential is configured with incorrect information, you cannot edit it, and must delete the credential and reconfigure a new one.
- Select Add to save the configuration. You are returned to the system configurations page.
TIP: Check your profile to ensure your credential was added and manage it.
- Select Test Connection to ensure your credential is working correctly. If you receive a
Success
message, your configuration is ready to use. If you receive an error code, ensure your Server URL is correct. If it is, typically there was an error in the credential configuration, and the configuration should be reconfigured.
The CloudBees CD plugin enables you to perform post-build actions for your Jenkins jobs. These actions can be executed separately or combined sequentially.
NOTE: To manage Post-build Actions, navigate to your Jenkins job's Configuration > Post-build Actions.
The CloudBees CD plugin allows you to make calls to CloudBees CD/RO's REST API for post-build actions and as pipeline steps. For more information on using the CloudBees CD/RO REST API, refer to Use the CloudBees CD/RO RESTful API.
To configure calls to CloudBees CD/RO's REST API:
-
Navigate to your job's Configuration > Post-build Actions menu.
-
Select Add post-build action.
-
In the filter field, enter
CloudBees CD - Call REST API
. -
Complete the fields with your configuration details. Select the ? icon to view field information in a new dialog.
IMPORTANT: For API parameters that include the phrase, "
request=<API-NAME>
must appear in your query string" in their description, you must include?request=<API-NAME>
in the Path URL field. For example:/objects?request=sendReportingData
: Where?
designates a query string,request
andsendReportingData
are required by thePOST object
API.
TIP: To reference CloudBees CD/RO REST API resources and descriptions, you can use CloudBees CD/RO's Swagger UI. To access the Swagger UI, navigate to
https://<cloudbees-cd-server_hostname>/rest/doc/v1.0/
, where<cloudbees-cd-server_hostname>
is the host name or IP address of your CloudBees CD/RO server.For more information on the Swagger UI, refer to Access the Swagger UI.
-
To apply the configuration to your job, select Save in the Jenkins UI.
node{
stage('Test') {
def result = cloudBeesFlowCallRestApi body: '', configuration: 'CdConfiguration', envVarNameForResult: 'CALL_REST_API_CREATE_PROJECT_RESULT', httpMethod: 'POST', parameters: [[key: 'projectName', value: 'CD-TEST-Jenkins-1.00.00.01'], [key: 'description', value: 'Native Jenkins Test Project']], urlPath: '/projects'
echo "result : $result"
echo "CALL_REST_API_CREATE_PROJECT_RESULT environment variable: $CALL_REST_API_CREATE_PROJECT_RESULT"
}
}
pipeline{
agent none
stages {
stage('Example Build') {
steps {
cloudBeesFlowCallRestApi body: '', configuration: 'CdConfiguration', envVarNameForResult: 'CALL_REST_API_CREATE_PROJECT_RESULT', httpMethod: 'POST', parameters: [[key: 'projectName', value: 'EC-TEST-Jenkins-1.00.00.01'], [key: 'description', value: 'Native Jenkins Test Project']], urlPath: '/projects'
}
}
stage('Example Build 2') {
steps {
echo "CALL_REST_API_CREATE_PROJECT_RESULT environment variable: $CALL_REST_API_CREATE_PROJECT_RESULT"
}
}
}
}
Using deployment packages generated from your Jenkins CI builds, you can create and deploy Java, .NET, or any other application to any environment in CloudBees CD/RO.
IMPORTANT: To create and deploy applications from a deployment package, the deployment package must contain a JSON manifest file and the artifacts to deploy.
Sample
manifest.json
files can be found in the CloudBees CD plug repo.
To set up this post-build action:
- Navigate to your job's Configuration > Post-build Actions menu.
- Select Add post-build action.
- In the filter field, enter
CloudBees CD - Create/Deploy Application from Deployment Package
. - Complete the fields with your configuration details. Select the ? icon to view field information in a new dialog.
- To apply the configuration to your job, select Save in the Jenkins UI.
node {
cloudBeesFlowCreateAndDeployAppFromJenkinsPackage configuration: 'CdConfiguration', filePath: 'CdProject/target/'
}
The CloudBees CD plugin enables you to deploy applications.
To set up this post-build action:
- Navigate to your job's Configuration > Post-build Actions menu.
- Select Add post-build action.
- In the filter field, enter
CloudBees CD - Deploy Application
. - Complete the fields with your configuration details. Select the ? icon to view field information in a new dialog.
- To apply the configuration to your job, select Save in the Jenkins UI.
node{
cloudBeesFlowDeployApplication applicationName: 'DemoApplication', applicationProcessName: 'RunCommand', configuration: 'CdConfiguration', deployParameters: '{"runProcess":{"applicationName":"DemoApplication","applicationProcessName":"RunCommand","parameter":[{"actualParameterName":"Parameter1","value":"value1"},{"actualParameterName":"Parameter2","value":"value2"}]}}', environmentName: 'CdEnvironment', projectName: 'CloudBees'
}
The CloudBees CD plugin allows you to publish application artifacts generated as part of your Jenkins CI jobs directly to CloudBees CD/RO.
To set up this post-build action:
- Navigate to your job's Configuration > Post-build Actions menu.
- Select Add post-build action.
- In the filter field, enter
CloudBees CD - Publish Artifact
. - Complete the fields with your configuration details. Select the ? icon to view field information in a new dialog.
- To apply the configuration to your job, select Save in the Jenkins UI.
node {
cloudBeesFlowPublishArtifact artifactName: 'application:jpetstore', artifactVersion: '1.0', configuration: 'CdConfiguration', filePath: 'CdProject/target/jpetstore.war', repositoryName: 'default'
}
The CloudBees plugin allows you to run pipelines in CloudBees CD.
To set up this post-build action:
- Navigate to your job's Configuration > Post-build Actions menu.
- Select Add post-build action.
- In the filter field, enter
CloudBees CD - Run Pipeline
. - Complete the fields with your configuration details. Select the ? icon to view field information in a new dialog.
- To apply the configuration to your job, select Save in the Jenkins UI.
node{
cloudBeesFlowRunPipeline addParam: '{"pipeline":{"pipelineName":"CdPipeline","parameters":[{"parameterName":"PipelineParam","parameterValue":"185"}]}}', configuration: 'CdConfiguration', pipelineName: 'CdPipeline', projectName: 'CloudBees'
}
The CloudBees CD plugin allows you to run procedures in CloudBees CD.
To set up this post-build action:
- Navigate to your job's Configuration > Post-build Actions menu.
- Select Add post-build action.
- In the filter field, enter
CloudBees CD - Run Procedure
. - Complete the fields with your configuration details. Select the ? icon to view field information in a new dialog.
- To apply the configuration to your job, select Save in the Jenkins UI.
node{
cloudBeesFlowRunProcedure configuration: 'CdConfiguration', procedureName: 'TomcatCheckServer', procedureParameters: '{"procedure":{"procedureName":"TomcatCheckServer","parameters":[{"actualParameterName":"max_time","value":"10"},{"actualParameterName":"tomcat_config_name","value":"Tomcat configuration"}]}}', projectName: 'CloudBees'
}
node{
cloudBeesFlowRunProcedure configuration: 'CdConfiguration', overrideCredential: [credentialId: 'CREDS_PARAM'], procedureName: 'TomcatCheckServer', procedureParameters: '{"procedure":{"procedureName":"TomcatCheckServer","parameters":[{"actualParameterName":"max_time","value":"10"},{"actualParameterName":"tomcat_config_name","value":"Tomcat configuration"}]}}', projectName: 'CloudBees', runAndWaitOption: [checkInterval: 5, dependOnCdJobOutcome: true]
}
IMPORTANT: This script relies on the Pipeline Stage API improvements and requires Jenkins 2.138.4 or newer.
Other required plugin versions are noted here: https://www.jenkins.io/blog/2019/07/05/jenkins-pipeline-stage-result-visualization-improvements/.
//...
script {
try {
// Note that both 'dependOnCdJobOutcome' and 'throwExceptionIfFailed' properties of the RunAndWait option should be set to true.
cloudBeesFlowRunProcedure configuration: 'electricflow', procedureName: 'prepareDeployment', procedureParameters: '{"procedure":{"procedureName":"prepareDeployment","parameters":[]}}', projectName: 'CloudBees', runAndWaitOption: [dependOnCdJobOutcome: true, throwExceptionIfFailed: true]
} catch (RuntimeException ex) {
if (ex.getMessage() =~ 'outcome=warning') {
unstable("The 'prepareDeployment' CD job was finished with warning. This needs further investigation.")
currentBuild.result = 'UNSTABLE'
} else if (ex.getMessage() =~ 'outcome=error') {
currentBuild.result = 'FAILURE'
unstable("The 'prepareDeployment' CD job was finished with error and the CI build should be stopped.")
throw ex
}
}
}
//...
This integration allows you to trigger a release in CloudBees CD/RO.
To set up this post-build action:
- Navigate to your job's Configuration > Post-build Actions menu.
- Select Add post-build action.
- In the filter field, enter
CloudBees CD - Trigger Release
. - Complete the fields with your configuration details. Select the ? icon to view field information in a new dialog.
- To apply the configuration to your job, select Save in the Jenkins UI.
node{
cloudBeesFlowTriggerRelease configuration: 'CdConfiguration', parameters: '{"release":{"releaseName":"CdRelease1.1.5","stages":[{"stageName":"Stage 1","stageValue":false},{"stageName":"Stage 2","stageValue":true}],"pipelineName":"pipeline_CdRelease1.1.5","parameters":[{"parameterName":"ReleaseParam","parameterValue":"test"}]}}', projectName: 'CloudBees', releaseName: 'CdRelease1.1.5', startingStage: ''
}
Details for this build are be attached to the Release Run (if supported by CloudBees CD/RO server).
[BEE-27725] When creating a new CloudBees CD configuration, you cannot add a new credential using the Add button.
You can use the following workarounds instead of the Add button to help you add a credential:
- The Add button works for existing configurations. Create and save your configuration without the credential. You can then return to the configuration and add the credential using the Add button.
- Add your credentials as described in Jenkins' Configuring credentials.
- Update Stage Option tool tips for Run Pipeline procedure.
- Fix issue in Post Build Action - Run Procedure where the dropdown icon for the config field would shift when choosing Procedure Name.
- Enabled Jenkins Security Scan
- Improved the Starting Stage options for the Trigger Release post-build action.
- Fixed issue that caused the Trigger Release post-build action to fail if Starting Stage was not defined. Now, if a value is not provided, the action defaults to Run All Stages.
- Fixed issue where Run Procedure failed if configured to run with parameters.
- Improved tool tips and documentation for Calling CloudBees CD REST API procedure.
- Internal improvements.
- Added option to only run specified stages.
- Updated UI snippet generator to generate scripts that support running only specified stages.
- Improved Post Build Actions to support running only specified stages.
- Fixed issue where credentials could not be added to new Cloudbees CD configuration.
- Fixed issue with Test Connection failing when using token authentication.
- Fixed issue with Compare Before Apply not comparing stage options that were changed.
- Fixed issue with Run Pipeline, where when configuring a Starting Stage, an error was returned for fetching pipeline stages to run.
- Fixed issue when running Run Pipeline post build actions a
NullPointerException
was returned causing the associated build step to fail.
- Added CloudBees CD/RO version dependencies section
- Fixed configuration as code issue with credentials ID.
- Updated connection configurations to support SSO.
- Removed dependencies on platform CGI scripts.
- Fixed plugin dependencies.
- Updated the plugin global configuration to support using stored credentials. Username and password or Secret text (token) can be used for connecting to CloudBees CD.
- Added support for Cloudbees CD tokens, which now can be configured default stored credentials (secret text) or to override configurations.
- Improved handling of override credentials.
- Fixed handling of stages in Trigger Release.
- Added support of folder credentials which now can be used within override credentials functionality.
- Fixed Upload Artifact when using agent.
- Improved integration of CloudBees CI and CD.
- Updated dependencies.
- Updated dependencies.
- Improved the Run And Wait option to support interrupting builds when Flow runtime was not finished successfully. This enhancement is applied to the following procedures:
- Trigger Release
- Run Pipeline
- Run Procedure
- Publish Application
- Create and Deploy Application from Deployment Package
- Updated Deploy application to support specifying an environment project if it is different from the application project.
- Fixed the following procedures for new Jenkins (2.264+) according to Jenkins forms
tabular to div
changes: Run Procedure, Run Pipeline, Deploy Application, and Trigger Release.
- Updated Publish Artifact with Relative Workspace parameter.
- Updated Run And Wait parameter checkInterval with minimum value.
- Updated Depend on CD job/pipeline outcome functionality by association of CloudBees CD job/pipeline outcome Warning with CloudBees CI build result Unstable.
- Updated build summary links for Run Pipeline, Publish Artifact, Trigger Release.
- Fixed snippet generator UI for pipeline steps with extra parameters, including Run Procedure, Trigger Release, Run Pipeline, Deploy Application).
- Event-based build watchers were improved and can now send build information after builds are finished.
- CloudBees CD Multibranch Pipelines support has been improved.
- Bug fixes and improvements.
-
Improvements:
- Updated the following post build actions with a Run and Wait option with possibility to depend on CD job or pipeline outcome:
- Run Pipeline
- Trigger Release
- Run Procedure
- Deploy Application
- Create and Deploy Application from Deployment Package
- Updated the following post build actions with a Run and Wait option with possibility to depend on CD job or pipeline outcome:
-
Improvements:
- Improved Run Procedure with a RunAndWait option that includes additional dependOnCdJobOutcome and checkInterval sub-options.
- Improved Trigger Pipeline error messages.
- Improved Run Procedure error handling.
- Improved build summary of Deploy Application with links to CD applications.
-
Bugfixes:
- Fixed an issue where Publish Artifact to created incorrect repository structures if artifacts were published from Jenkins agent nodes.
- Fixed an issue cased by double slashes in CD Artifacts URL.
- Deploy Application PBA now has a link to the exact application deployed instead of a link to all applications on customer instance.
- Fixed an issue in EC-Jenkins when artifact URLs could not be retrieved for the Report stage of Run And Monitor and Run And Wait under certain conditions.
- Fixed release retrieval code
- Fixed issue where Publish Artifacts was failing successful builds under some conditions.
- Fixed a bug when parameter Stages to run was ignored and all stages were running.
-
Documentation, help tips and labels:
- Updated plugin documentation with new screenshots and pipeline code samples.
- Updated parameter labels for Trigger release to improve usability.
- Updated help tips and added supported use cases for Publish Artifacts and Create/Deploy Application from Deployment Package to improve usability.
-
Added support for new CI Build Detail APIs:
- Added new Post Build Action Associate Build To Release to allow attaching CI Build Data of the independent builds to releases or release runs.
- Run Pipeline now attaches CI Build Data to the triggered pipeline run.
- Trigger Release now attaches CI Build Data to the triggered release pipeline run.
-
Improved integration with CloudBees CD:
- CI Build Data infrastructure has been created.
- Created event-based watchers to send build data to CloudBees CD automatically if build is triggered by CloudBees CD.
-
Renamed from "CloudBees Flow" to "CloudBees CD".
- Added support of Configuration as Code.
- Updated plugin dependencies.
- All Post Build Actions can now connect to CloudBees Flow as a user other than the one mentioned in the
electricflow
Plugin configuration, under Manage Jenkins. These credentials which are used to override the connection credential at the level of the PBA only supports global credentials at this time. - Fixed parameters collision for pipelines with the same name in the Trigger Release and Run Pipeline Post Build Actions.
- Fixed corrupted artifact uploading in the Publish Artifact Post Build Action.
- Updated plugin dependencies.
Migrated plugin documentation from Wiki to GitHub.
Updated CloudBees Flow - Publish Artifact:
-
Added pipeline compatibility.
-
Fixed support of running on agents.
-
Updated CloudBees Flow - Create and Deploy Application from Deployment Package:
- Added pipeline compatibility.
- Fixed support of running on agents.
- Added link to CloudBees Flow job within summary of a build.
-
Added pipeline function aliases for all post build actions.
-
Added expand environment variable functionality for the following post build actions:
- CloudBees Flow - Call REST API
- CloudBees Flow - Run Procedure
- CloudBees Flow - Deploy Application
-
Added a sample Jenkinsfile to the plugin repository.
-
Updated CloudBees Flow - Call REST API related functionality:
- Added support for a new workflow step, CloudBees Flow - Call REST API, which is based on the same functionality as corresponded post build action. Additionally, a snippet generator UI is available for the new workflow step.
- Result of calling CloudBees Flow REST API (JSON output) now can be stored within environment variables available within builds. They can also be returned by the new workflow step within scripted pipelines.
- Fixed URL on summary page of Call REST API jobs.
-
Changed Jenkins baseline version for the plugin to 2.138.4.
- Added basic unit tests
- Re-branding: renaming from "Electric Flow" to "CloudBees Flow"
- Fix security issue (SECURITY-1420)
- Fix security issues (SECURITY-1410, SECURITY-1411, SECURITY-1412)
-
Support for the following New Post Build Actions have been added:
- ElectricFlow - Deploy Application
- ElectricFlow - Trigger Release
- ElectricFlow - Call REST API
- ElectricFlow - Run Procedure
-
Post Build Action ElectricFlow - Run Pipeline modified as follows:
- It can now be run for pipelines without parameters.
-
Post Build Action ElectricFlow - Publish Artifact modified as follows:
- Added support for publishing to both directories and subdirectories.
- Explicit error messages added for build runs.
-
Usability changes:
- Post Build Action page shows dynamically retrieved values all the time.
- Two new buttons Validate Before Apply and Compare Before Apply added in Post Build Action Pages for Deploy Applicatio, Trigger Release, Run Procedure and Run Pipeline. This is to help ensure failures to retrieve information is handled gracefully (no stack traces), and users can understand the field errors before saving the configuration.
- More descriptive Help tips.
- More verbose messages when Test Connection fails with Electric Flow.
- More verbose logging on response body for failed Rest API calls.
- New option called Override Electric Flow SSL Validation Check" was introduced for testing connection with Electric Flow, where there is a need to test Electric Flow Post Build Actions before doing the SSL setup.
Post Build Action "ElectricFlow - Publish Artifact" modified as follows:
- Fixed Scenarios where Build Step fails with exceptions.
- Added Support for remoting (build on remote Windows machines).
Support added for running plugin tasks from jenkins pipeline as per https://issues.jenkins-ci.org/browse/JENKINS-44084.
- More detailed output from plugin on build page results.
- Hierarchy files output added to build page.
General clean up of code.
Initial Release.