DEPRECATED - Use DevOps Insights CLI instead - https://cloud.ibm.com/docs/cli?topic=cli-CLI_devops-insights
Please go to https://wiki.jenkins-ci.org/display/JENKINS/IBM+Cloud+DevOps+Plugin for the latest instructions of this plugin
With this Jenkins plugin, You can publish test results to DevOps Insights, add automated quality gates, and track your deployment risk. You can also send your Jenkins job notifications to other tools in your toolchain, such as Slack and PagerDuty. To help you figure out when code was deployed, the system can add deployment messages to your Git commits and your related Git or JIRA issues. You can also view your deployments on the Toolchain Connections page.
This plugin provides Post-Build Actions and CLIs to support this inteigration. DevOps Insights aggregates and analyzes the results from unit tests, functional tests, code-coverage tools, static security code scans and dynamic security code scans to determine whether your code meets predefined policies at gates in your deployment process. If your code does not meet or exceed a policy, the deployment is halted, preventing risky changes from being released. You can use DevOps Insights as a safety net for your continuous delivery environment, a way to implement and improve quality standards over time, and a data visualization tool to help you understand your project's health.
Before you can integrate DevOps Insights with a Jenkins project, you must create a toolchain. A toolchain is a set of tool integrations that support development, deployment, and operations tasks. The collective power of a toolchain is greater than the sum of its individual tool integrations. Toolchains are part of the IBM Bluemix® Continuous Delivery service. To learn more about the Continuous Delivery service, see its documentation.
-
To create a toolchain, go to the Create a Toolchain page and follow the instructions on that page.
-
After you create the toolchain, add DevOps Insights to it. For instructions, see the DevOps Insights documentation.
If you would like to make use Deployment Risk dashboard, follow these steps.
After the plugin is installed, you can integrate DevOps Insights into your Jenkins project.
-
Open the configuration of any jobs that you have, such as build, test, or deployment.
-
Add a post-build action for the corresponding type:
-
For build jobs, use Publish build information to IBM Cloud DevOps.
-
For test jobs, use Publish test result to IBM Cloud DevOps.
-
For deployment jobs, use Publish deployment information to IBM Cloud DevOps.
-
-
Complete the required fields:
-
From the Credentials, select your Bluemix ID and password. If they are not saved in Jenkins, click Add to add and save them. Click Test Connection to test your connection with Bluemix.
-
In the Build Job Name field, specify your build job's name exactly as it is in Jenkins. If the build occurs with the test job, leave this field empty. If the build job occurs outside of Jenkins, select the Builds are being done outside of Jenkins check box and specify the build number and build URL.
-
For the environment, if the tests are running in build stage, select only the build environment. If the tests are running in the deployment stage, select the deploy environment and specify the environment name. Two values are supported:
STAGING
andPRODUCTION
. -
For the Result File Location field, specify the result file's location. If the test doesn't generate a result file, leave this field empty. The plugin uploads a default result file that is based on the status of current test job.
Example configurations
-
-
(Optional): If you want to use DevOps Insights policy gates to control a downstream deploy job, add a post build action, IBM Cloud DevOps Gate. Choose a policy and specify the scope of the test results. To allow the policy gates to prevent downstream deployments, select the Fail the build based on the policy rules check box. The following image shows an example configuration:
-
Run your Jenkins Build job.
-
Go to the IBM Bluemix DevOps, select your toolchain and click on DevOps Insights card to view Deployment Risk dashboard.
3. (Optional) Configure Jenkins jobs to send notifications to tools in your toolchain (e.g., Slack, PagerDuty), and enable traceability
Configure your Jenkins jobs to send notifications to tools integrated to your toolchain (e.g., Slack, PagerDuty), and use traceability to track code deployments through tags, labels, and comments in your Git repository (repo).
Both Freestyle projects and Pipeline are supported.
Detailed instructions are available in the Bluemix Docs.
Example configurations
- Configuring the IBM_CLOUD_DEVOPS_WEBHOOK_URL for job configurations:
- Configuring post-build actions for job notifications:
- Configuring post-build actions to track deployment of code changes:
Copyright© 2016, 2017 IBM Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.