ТЕМА: El Monte : running selenium tests from tfs - Eduard Kabrinskiy

El Monte : running selenium tests from tfs - Eduard Kabrinskiy 2 років 10 місяців тому #30273

Kabrinskiy Eduard - Jenkins devops - Кабринский Эдуард


<h1>Jenkins devops</h1>
<p>[youtube]</p>
Jenkins devops <a href="remmont.com">Top news stories</a> Jenkins devops
<h1>IBM Cloud DevOps</h1>
<p>This plugin lets you integrate Jenkins with IBM DevOps Insights. DevOps Insights tracks your deployment risk based on the test data that you publish to it. This test data may include unit tests, code coverage, functional verification tests, SonarQube data, and scan data from IBM Application Security on Cloud. Once you publish this data, you can add gates to your pipelines so that you can stop builds that don't meet risk policies.</p>
<p>You can also use DevOps Insights to analyze your code repositories, which can yield valuable information about error-prone files, commit trends, and team dynamics.</p>
<p>Here is the Quality Dashboard view that shows which Applications perform which type of tests. For example, synthetic-agent does Code Coverage, Unit Test, Functional Verification Test but does not perform SonarQube tests. From this view, you can also navigate to trends graph so that you can see trends for a specific application for a specific test type.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118...lity%20Dashboard.png" /></p>
<p>The Quality Data Set view can show quality data by a specific branch. If you use multiple branches for various environments, you can view this data by branch.</p>
<p>The tool lets you specify the types of tests (Data Sets) that you want to represent in the system with just a few clicks. In the above screenshot, the user has created "Sandbox Unit Test", "Upgrade Verification Test" etc. Once you define a Data Set, you can create a policy with rules around the Data Set. Once you start populating data for a Data Set, the Data Set will appear in the Quality Dashboard when your pipeline runs. You can also reorder the columns of the Quality Dashboard.</p>
<p>You can define one more policies that can be used to determine if a specific build should be promoted to the next environment. Since applications in a project have different levels of maturity, you can create separate policies for each application or even have multiple policies for a single application. Each policy has one or more rules.</p>
<p>This is an example of a policy containing seven rules.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/02-Policy.png" /></p>
<p>This is an example of a Code Coverage rule.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/03-Rule.png" /></p>
<p>This is an example of a Unit Test rule:</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118...2/04-Unit%20test.png" /></p>
<p>You can also create rules on any custom Data Sets that you created. For example, if you created a Data Set for "Integration Test", you can create a rule for that Data Set in your policies.</p>
<p>Here is a view that shows deployment risk associated with various microservices that are deployed in an environment.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/05-RA.png" /></p>
<p>Here is a view that shows deployment risk. This view shows all builds that are in flight for a given Microservice and their deployment risk.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/06-RA.png" /></p>
<p>Here is a view that shows deployment risk details for a specific microservice and build. At the top, the UI provides information about last commit for the build and link to Jenkins for that specific build.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/07-RA.png" /></p>
<p>Then, the UI can show details of a specific test as well. In some cases, it will point to the original tool for details.</p>
<p>With this information on their fingertips, devops teams know which build is deployed in which environment, the quality of each build, link to commits and automated risk analysis based on the thresholds that an admin sets. All stakeholders can have access to this information to view how their development teams are performing.</p>
<p>You can also view trends for unit test and functional verification tests for the builds that are from a certain branch or deployed to a certain environment. For example, you can see test trends for builds from the master branch. If some tests have been failing for builds that went to production, you may want to take some action. Also, if number of tests are dwindling over time, that may also be a cause for concern.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/08-Trends.png" /></p>
<p>You can also view code coverage trends for the builds that are deployed to a certain environment. For example, you can see code coverage trends for builds that went to production. Ideally, you should see that code coverage improve over time for builds that went to production. If code coverage has been going down, you may want to take action.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/09-Trends.png" /></p>
<p>You can also view deployment frequency trends for your production, staging or other environments. This view also shows deployment success and failures. You can click on a point of interest and see deployment details. If yours is an agile team, you should see the deployment frequency trends go up.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118...2/10-Deployments.png" /></p>
<p>You can also view build frequency trends for your long running branches. This view also shows build success and failures. You can click on a point of interest and see build details. If yours is an agile team, you should see a lot of daily builds on the integration branch. Otherwise, your team is not merging their code frequently.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/11-Build.png" /></p>
<h1>Supported Tools and Formats</h1>
<p>We currently support the following test formats.</p>
<table style="width: 48.4133%;"> <tbody> <tr> <th style="text-align: center;" >Type</th> <th style="text-align: center;" >Formats</th> </tr> <tr> <td >Unit Test</td> <td >JUnit (json), xUnit (xml), Mocha (json), KarmaMocha (json)</td> </tr> <tr> <td >Function Tests</td> <td >JUnit (json), xUnit (xml), Mocha (json), KarmaMocha (json)</td> </tr> <tr> <td >Code Coverage</td>
<p>Cobertura (xml), lcov, Istanbul (json), JaCoCo (xml)</p>
</tr> <tr> <td colspan="1" >Sonarqube</td> <td colspan="1" >Sonarqube</td> </tr> <tr> <td colspan="1" >Static Security Scan</td> <td colspan="1" >IBM Application Security on Cloud (xml)</td> </tr> <tr> <td colspan="1" >Dynamic Security Scan</td> <td colspan="1" >IBM Application Security on Cloud (xml)</td> </tr> <tr> <td colspan="1" >IBM Vulnerability Advisor</td> <td colspan="1" >IBM Vulnerability Advisor (json)</td> </tr> <tr> <td colspan="1" >Custom Data Sets - Tests</td> <td colspan="1" >JUnit (json), xUnit (xml), Mocha (json), KarmaMocha (json)</td> </tr> <tr> <td colspan="1" >Custom Data Sets - Code Coverage</td>
<p>Cobertura (xml), lcov, Istanbul (json), JaCoCo (xml)</p>
<p>For golang gocov users, please convert to Cobertura using gocov XML(Cobertura) export</p>
<h1>Connect with Us</h1>
<p>For a demo and technical deep dive, please connect with Vijay Aggarwal via Linked In or via email.</p>
<h1>Sample Pipelines and Code</h1>
<p>Here are two complete pipeline examples defined as declarative Jenkinsfile and a scripted Jenkinsfile.</p>
<p>This git repo contains a sample nodejs application code and tests, as well as a Jenkinsfile, you can play with it by simply forking this repo and modifying the Jenkinsfile to replace all the placeholder with your actual information. (Note: if you don't have NodeJS installed in your Jenkins environment, you might have to install the node.js Jenkins plugin. If you do have NodeJS installed, you can comment out the "tools" section in the Jenkinsfile)</p>
<h1>Prerequisites</h1>
<p>At a high level, here are the integration steps. These steps are described later in this document.</p>
<p><ul>
<li>An IBM Cloud account. Create account</li>
<li>A DevOps toolchain. Learn more about toolchains here.</li>
<li>The Jenkins plugin. Install plugin</li>
<li>DevOps Insights</li>
</ul>
</p>
<h1>Creating a toolchain</h1>
<p>Before you can integrate DevOps Insights with a Jenkins project, you must create a toolchain and add the DevOps Insights and Jenkins tools to it.</p>
<p>First, create an empty toolchain that you can add tools to.</p>
<p>Under Other Templates, click the <strong>Build your own toolchain</strong> template.</p>
<p>Name the toolchain and click <strong>Create</strong>.</p>
<p>Next, add the DevOps Insights and Jenkins tools to your toolchain.</p>
<p>On the toolchain's Overview page, click <strong>Add a tool.</strong></p>
<p></li>
<li>Click the <strong>DevOps Insights</strong> tile, and then click <strong>Create Integration</strong>.</li>
<li>On the toolchain's Overview page, click <strong>Add a tool</strong> again.</li>
<li>Click the <strong>Jenkins</strong> tile.</li>
<li>Enter the name and URL for your existing Jenkins project.</li>
<li>Click <strong>Create Integration.</strong></li>
</ol>
</p>
<p>You now have a toolchain that lets use DevOps Insights with Jenkins.</p>
<h1>Integrating Jenkins Pipeline with DevOps Insights</h1>
<ol>
<li>Install this plugin using the plugin manager (<u>plugins.jenkins.io/ibm-cloud-devops)</u>. This plugin supports both declarative or scripted formats. It also supports Jenkins jobs.</li>
<li>Connect your application</li>
</ol>
<p>Open the pipeline definition or script and add these environment variables</p>
<p>In the definition, add the following environment variables. These variables are required for the pipeline to integrate with DevOps Insights.</p>
<table > <tbody> <tr> <th >Environment variable</th> <th >Definition</th> </tr> <tr>
<p>This is a unique code that is passed in to an application programming interface (API) to identify the calling application or user.</p>
<p>To create an API key in IBM Cloud: Select Manage ? Security ? Platform API Keys in the header of the page. Click create and name the API key. You can follow console.bluemix.net/docs/iam/apikeys.html#creating-an-api-key</p>
<p>Store the API key as Jenkins credentials. (secret text type).</p>
</tr> <tr> <td >IBM_CLOUD_DEVOPS_APP_NAME</td> <td >The name of the application that your toolchain deploys. If applicationName parameter is passed to the step job then this value is ignored for that step.</td> </tr> <tr>
<p><td >The ID of your toolchain. To find the Toolchain ID:</p>
<p>On the page containing your toolchain, select the toolchain with Jenkins (show screenshot) to see the Toolchain Overview page. Look in the address bar for the URL to determine the Toolchain ID.</p>
<p>Toolchain ID: 99c643c3-23d9-4030-9b1f-3aadfd7f9d09</td> </tr> </tbody> </table> </p>
<p>Tip: See the Jenkins pipeline documentation for more information about the credentials command.</p>
<p>Tip: If you are using the the scripted pipeline format, set your credentials with withCredentials and your environment with withEnv instead of credentials and environment , which are used in the example below. See the Jenkins documentation for more about withCredentials .</p>
<p>These environment variables and credentials are used by the IBM Cloud DevOps plugin to interact with DevOps Insights. Here is an example of setting them in the declarative pipeline format.</p>
<h2>Adding Cloud DevOps steps</h2>
<p>The Cloud DevOps plugin adds four steps to Jenkins pipelines for you to use. Use these steps in your pipelines to interact with DevOps Insights.</p>
<p><ul>
<li>publishBuildRecord , which publishes build information to DevOps Insights</li>
<li>publishTestResult , which publishes test results to DevOps Insights</li>
<li>publishDeployRecord , which publishes deployment records to DevOps Insights</li>
<li>evaluateGate , which enforces DevOps Insights policies</li>
</ul>
</p>
<p>Add these steps to your pipeline definition wherever you need them to run. For example, you might upload test results after running a test, and then evaluate those results at a gate after they are uploaded.</p>
<p>Tip: by default, the version number is set to be <pipeline name>:<build number>, you can also set the custom version number in each step</p>
<h3>Publishing build records</h3>
<p>Publish build records with the publishBuildRecord step. This step requires four parameters. It can also accept one optional parameter.</p>
<table > <thead> <tr> <th style="text-align: left;" >Parameter</th> <th style="text-align: left;" >Definition</th> </tr> </th> <tbody> <tr> <td >gitBranch</td> <td >The name of the Git Branch that the build uses.</td> </tr> <tr> <td >gitCommit</td> <td >The Git commit ID that the build uses.</td> </tr> <tr> <td >gitRepo</td> <td >The URL of the Git repository.</td> </tr> <tr> <td >result</td> <td >The result of the build stage. The value should be SUCCESS or FAIL .</td> </tr> <tr> <td colspan="1" ><em>Optional:</em> Set value to any string - this represents version number</td> </tr> <tr> <td colspan="1" >applicationName</td> <td colspan="1" ><em>Optional</em>: Set the application name. If this value is set the environment variable IBM_CLOUD_DEVOPS_APP_NAME will be ignored.</td> </tr> </tbody> </table>
<p>Here are the parameters in an example command:</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118...-build%20example.png" /></p>
<p>Tip: Jenkins Pipeline does not expose Git information as environment variables. You can get the Git commit ID by using the command sh(returnStdout: true, script: 'git rev-parse HEAD').trim() .</p>
<h3>Publishing test results</h3>
<p>Publish build records with the publishTestResult step. This step requires two parameters. It can also accept one optional parameter.</p>
<table > <thead> <tr> <th style="text-align: left;" >Parameter</th> <th style="text-align: left;" >Definition</th> </tr> </th> <tbody> <tr> <td >type</td> <td >The type of test result. The value of this can be unittest for unit tests, fvt for functional verification tests, code for code coverage tests, staticsecurityscan for static security scan result, dynamicsecurityscan for dynamic security scan, or any other tag that you defined from Control Center</td> </tr> <tr> <td >fileLocation</td> <td >The test result file's location.</td> </tr> <tr> <td colspan="1" >The environment name that your test runs on, only required for fvt (functional verification tests)</td> </tr> <tr> <td colspan="1" ><em>Optional:</em> Set value to any string - this represents version number</td> </tr> <tr> <td colspan="1" >applicationName</td> <td colspan="1" ><em>Optional</em> : Set the application name. If this value is set the environment variable IBM_CLOUD_DEVOPS_APP_NAME will be ignored.</td> </tr> </tbody> </table>
<p>Here are the parameters in example commands. The first command publishes Mocha unit test results, and the second command publishes code coverage test results.</p>
<h3><br />Publishing SonarQube results</h3>
<p>After you configure a SonarQube scanner and server by following the instructions in the SonarQube docs, you can publish scan results to DevOps Insights.</p>
<p>To configure your Jenkins Pipeline to accept these results, add the following three required parameters and one optional parameter to it:</p>
<table > <thead> <tr> <th >Parameter</th> <th >Definition</th> </tr> </th> <tbody> <tr> <td >SQHostURL</td> <td >The host portion of your SonarQube scanner's URL. Get this from from your SonarQube server.</td> </tr> <tr> <td >Your SonarQube API authentication token. Get this from your SonarQube server.</td> </tr> <tr> <td >The project key of the SonarQube project you wish to scan.</td> </tr> <tr> <td colspan="1" ><em>Optional:</em> Set value to any string - this represents version number</td> </tr> <tr> <td colspan="1" >applicationName</td> <td colspan="1" ><em>Optional</em> : Set the application name. If this value is set the environment variable IBM_CLOUD_DEVOPS_APP_NAME will be ignored.</td> </tr> </tbody> </table>
<p>Here are the SonarQube parameters used in a sample stage:</p>
<h3><br />Publishing deployment records</h3>
<p>Publish deployment records with the publishDeployRecord step. This step requires two parameters. It can also accept two optional parameter.</p>
<table > <thead> <tr> <th style="text-align: left;" >Parameter</th> <th style="text-align: left;" >Definition</th> </tr> </th> <tbody> <tr> <td >environment</td> <td >The environment that you deploy your app to. For example, "DEV" or "STAGING" or any other value</td> </tr> <tr> <td >result</td> <td >The result of the build stage. The value should be SUCCESS or FAIL .</td> </tr> <tr> <td >appUrl</td> <td >Optional</em>: The URL used to access your application.</td> </tr> <tr> <td colspan="1" ><em>Optional:</em> Set value to any string - this represents version number</td> </tr> <tr> <td colspan="1" >applicationName</td> <td colspan="1" ><em>Optional</em> : Set the application name. If this value is set the environment variable IBM_CLOUD_DEVOPS_APP_NAME will be ignored.</td> </tr> </tbody> </table>
<p>Here are the parameters in example commands. The first command publishes the deployment record for a staging environment; the second command publishes the deployment record for a production environment.</p>
<h3>Adding gates</h3>
<p>The first step is to define Gate Policies. Policies are sets of rules that control the gates in your delivery pipeline. If your code does not meet or exceed a policy that is enacted at a particular gate, the deployment is halted to prevent risky changes from being released.</p>
<p>You define policies in DevOps Insights, rather than in Jenkins.</p>
<p>To open the DevOps Insights Policies page:</p>
<p><ol>
<li>Open DevOps Insights and select Policies in the sidebar navigation.</li>
<li>Select 'Create New Policy' and name your policy</li>
<li>Add a rule. (*yes, the user will have to have data before they add a policy. It would be odd for them to add a policy on an application that has no test results. Plus, most users run tests for a while before adding a policy.)</em></li>
<li>Connect the Insights Policy to Gates in your pipeline.<br /><strong><br /></strong></li>
</ol>
</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/02-Policy.png" /></p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/03-Rule.png" /></p>
<p>From here, you can define policies, add rules to them, and then add them to gates in your Jenkins projects. <br />For more information, see Creating policies and rules in the Bluemix documentation.</p>
<p>Once policies have been created, add gates to your pipeline by using the evaluateGate command. Gates enforce DevOps Insights policies, which set test requirements for build promotion.</p>
<p>This step requires one parameters. It can also accept two optional parameter.</p>
<table > <thead> <tr> <th style="text-align: left;" >Parameter</th> <th style="text-align: left;" >Definition</th> </tr> </th> <tbody> <tr> <td >policy</td> <td >The name of the policy that the gate implements. The policy's name is defined in DevOps Insights.</td> </tr> <tr> <td >Optional</em>: Whether or not the pipeline stops depending on the gate's decision. Set this parameter to true to stop the pipeline from running if the gate fails. Set it to false to allow the pipeline to continue after a gate failure. By default, the value is false .</td> </tr> <tr> <td colspan="1" ><em>Optional:</em> Set value to any string - this represents version number</td> </tr> <tr> <td colspan="1" >applicationName</td> <td colspan="1" ><em>Optional</em> : Set the application name. If this value is set the environment variable IBM_CLOUD_DEVOPS_APP_NAME will be ignored.</td> </tr> </tbody> </table>
<p>Here are the parameters in an example command. In this command, the pipeline will continue running regardless of the gate's decision.</p>
<h3>Communicating with toolchains</h3>
<p>Send pipeline status to IBM Cloud DevOps toolchains by using the notifyOTC command. To learn more about integrating Jenkins with toolchains, see Notifying toolchains section below.</p>
<p>This step requires two parameters and can take an additional optional one.</p>
<table > <thead> <tr> <th style="text-align: left;" >Parameter</th> <th style="text-align: left;" >Definition</th> </tr> </th> <tbody> <tr> <td >stageName</td> <td >The current pipeline stage's name.</td> </tr> <tr> <td >status</td> <td >The current pipeline stage's status. Using SUCCESS , FAILURE , or ABORTED will automatically trigger color highlighting in Slack.</td> </tr> <tr> <td >webhookUrl</td> <td >Optional</em>: The webhook URL that is shown on your toolchain's Jenkins tile. If you include this parameter, its value overrides that of the IBM_CLOUD_DEVOPS_WEBHOOKURL environment variable.</td> </tr> </tbody> </table>
<p>Here are examples of using the notifyOTC step in both declarative and scripted pipeline definitions:</p>
<h1>Integrating with freeform Jenkins projects</h1>
<h2>Configuring Jenkins jobs for the Deployment Risk dashboard</h2>
<p>After the plugin is installed, you can integrate DevOps Insights into your Jenkins project.</p>
<p>Follow these steps to use DevOps Insights gates and dashboard with your project.</p>
<p>Open the configuration of any jobs that you have, such as build, test, or deployment.</p>
<p>Add a post-build action for the corresponding type:</p>
<p>For build jobs, use <strong>Publish build information to IBM Cloud DevOps</strong> .</p>
<p>For test jobs, use <strong>Publish test result to IBM Cloud DevOps</strong> .</p>
<p>For deployment jobs, use <strong>Publish deployment information to IBM Cloud DevOps</strong> .</p>
<p>Complete the required fields. These will vary depending on job type.</p>
<p>From the <strong>Credentials</strong> list, select your IBM Cloud API key. If they are not saved in Jenkins, click <strong>Add</strong> to add and save them. You should use the "<em>secret text</em>" type to store your API key. Test your connection with Bluemix by clicking <strong>Test Connection</strong> .</p>
<p>In the <strong>Build Job Name</strong> 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 <strong>Builds are being done outside of Jenkins</strong> check box and specify the build number and build URL.</p>
<p>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.</p>
<p>For the <strong>Result File Location</strong> 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.</p>
<p></li>
<li>For the <strong>SonarQube hostname</strong> and <strong>SonarQube authentication token</strong> fields, specify the hostname and token that are configured on your SonarQube Server. For the <strong>SonarQube project key</strong> field, specify the project key of the SonarQube project that you wish to scan.</li>
</ul>
</p>
<p style="clear: both">These images show example configurations: <br /> <img style="float: left; margin: 0 10px 5px 0;" src="wiki.jenkins.io/download/attachments/118...pload-Build-Info.png" /></p>
<p>Publish build information</em></p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118...load-Test-Result.png" /></p>
<p>Publish test result</em></p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118...2/Upload-SQ-Data.png" /></p>
<p>Publish SonarQube test result</em></p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118...-Deployment-Info.png" /></p>
<p>Publish deployment information</em></em></p>
<p></em></em>4. If you want to use DevOps Insights policy gates to control a downstream deployment job, add a post-build action, <strong>IBM Cloud DevOps Gate</strong> . Choose a policy and specify the scope of the test results. To allow the policy gates to prevent downstream deployments, select the <strong>Fail the build based on the policy rules</strong> check box. The following image shows an example configuration:</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118096472/DRA-Gate.png" /></p>
<p>5. Run your Jenkins Build job.</p>
<p>6. View the Risk Analysis dashboard by going to IBM Cloud DevOps, selecting your toolchain, and clicking DevOps Insights .</p>
<p>The Risk Analysis dashboard relies on the presence of a gate after a staging deployment job. If you want to use the dashboard, make sure that you have a gate after you deploy to the staging environment, but before you deploy to a production environment.</p>
<h1>Notifying toolchains</h1>
<p>You can 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).</p>
<p>Both Freestyle projects and Pipeline are supported.</p>
<h2>Prerequisites</h2>
<h3>Create a toolchain</h3>
<p>Refer to IBM Cloud documentation in order to create a tool chain that will integrate your Jenkins server to other tools such as Github, Insights, Slack and PagerDuty.</p>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118...ample_tool_chain.png" /></p>
<p><ul>
<li>Slack integration is detailed in the IBM Cloud documentation.</li>
<li>PagerDuty integration is detailed in the IBM Cloud documentation.</li>
</ul>
</p>
<h3>Jenkins Webhook URL</h3>
<ol>
<li>On your tool chain main page, click the 3 dots in top right corner of the Jenkins tile, and select configure.</li>
<li>Take note - copy / paste it in a notepad - of the Generated toolchain webhook URL. Webhook URL uses a format like:<br />https://jenkins:c3cd97bc-b987-43bd-8020-c14bd1b1366a:8996de45-380a-40b2-a099-65a6eeb9a466@devops-api.ng.bluemix.net/v1/toolint/messaging/webhook/publish</li>
</ol>
<h3>Add bluemix credentials to Jenkins</h3>
<p>This configuration step is common to both Freestyle or Pipeline projects.</p>
<p><ol>
<li>On the Manage Jenkins page, select Manage Credentials</li>
<li>Scope: global</li>
<li>Username: your IBM Cloud user id</li>
<li>Password: corresponding password</li>
<li>ID: IBM_CLOUD_DEVOPS_CREDS</li>
<li>(optional) Description: IBM Cloud creds</li>
<li>Save your changes</li>
</ol>
</p>
<p>These credentials will be used in Freestyle or Pipeline jobs using the credentials ID.</p>
<h2>Freestyle job</h2>
<ol>
<li>Create a new Freestyle project</li>
<li>Select "This project is parameterized". </ol>
<p>Add the String following parameters:</p>
<table > <tbody> <tr> <th style="text-align: left;" >Name</th> <th style="text-align: left;" >Default Value</th> </tr> <tr> <td style="text-align: left;" >IBM_CLOUD_DEVOPS_ORG</td> <td style="text-align: left;" >the IBM Cloud org where your application is deployed</td> </tr> <tr> <td style="text-align: left;" >IBM_CLOUD_DEVOPS_SPACE</td> <td style="text-align: left;" >the IBM Cloud space where your application is deployed</td> </tr> <tr> <td style="text-align: left;" >IBM_CLOUD_DEVOPS_APP_NAME</td> <td style="text-align: left;" >the name of your application as deployed to IBM Cloud</td> </tr> <tr> <td style="text-align: left;" >IBM_CLOUD_DEVOPS_WEBHOOK_URL</td> <td style="text-align: left;" >the Jenkins webhook URLof your toolchain</td> </tr> </tbody> </table>
<p style="clear: both"> <img src="wiki.jenkins.io/download/attachments/118...freestyle_params.png" /></p>
<p style="clear: both">
Source Code Management: select Git, and enter the URL and branch of the Git repository as configured in your toolchain. <br /><img style="float: left; margin: 0 10px 5px 0;" src="wiki.jenkins.io/download/attachments/118...eestyle_git_repo.png" /></p>
<p style="clear: both">
Build triggers: select Poll SCM in order to start job automatically after a Git commit. Enter your schedule options. <br /><img style="float: left; margin: 0 10px 5px 0;" src="wiki.jenkins.io/download/attachments/118...yle_git_poll_scm.png" /></p>
<p style="clear: both">
Build Environment<br />- Select Use secret text(s) or file(s)<br />- Add Username and password (separated)<br />- Username Variable: IBM_CLOUD_DEVOPS_CREDS_USR<br />- Password Variable: IBM_CLOUD_DEVOPS_CREDS_PSW<br />- Credentials: select the IBM Cloud specific credentials you added to Jenkins server <br /><img style="float: left; margin: 0 10px 5px 0;" src="wiki.jenkins.io/download/attachments/118...eestyle_bindings.png" /></p>
<p>Build step is not detailed here, as the script deploying your application to bluemix might be specific to your environment. <br />Below is a simple sample Shell script example that pushes your application to IBM Cloud.</p>
<p style="clear: both"></li>
<li>Post-build action: add the Notify OTC post-build action.</li>
<li>Select the options matching your needs:<br />- Notify Slack on Job started, completed or finalized events,<br />- Notify PagerDuty on Job faliures only<br />- Select Track deployment of code changes to enable traceability to track code deployments through tags, labels, and comments in your Git repository. <br /><img style="float: left; margin: 0 10px 5px 0;" src="wiki.jenkins.io/download/attachments/118...style_post_build.png" /></p>
<p></li>
<li>Save your changes.</li>
<li>You may test your Freestyle job by either:<br />- Jenkins: select "Build with parameters" and launch a build.<br />- Git: commit some changes and wait for SCM polling (if enabled) to pick up the changes and launch a build.</li>
</ol>
</p>
<h2>Pipeline</h2>
<ol>
<li>Create a new Pipeline.</li>
<li>Deployment script is not detailed here. To use IBM Cloud DevOps with the Jenkins pipeline project, you can follow th e declarative and scripted examples</li>
</ol>
<h3>Publish the status of your pipeline stages to your Bluemix Toolchain</h3>
<p>Configure your Jenkins pipelines to send notifications to tools integrated to your IBM Cloud Toolchain (e.g. Slack, PagerDuty).</p>
<p>Ensure you added the 5 required environment variables to your script, as detailed here.</p>
<p>Declarative Pipeline Example: <br /></p>
<h3>Track deployment of code changes</h3>
<p>Configure your Jenkins pipelines to send deployable mapping messages to your IBM Cloud toolchain,<br />to track code deployments through tags, labels, and comments in your Git repository.</p>
<p>Use this notification only for status 'SUCCESS'. Any other status will be discarded.</p>
<p>Add a new environment variable to your script:<br />IBM_CLOUD_DEVOPS_SPACE: the IBM Cloud space where your application is deployed</p>
<h2>Jenkins devops</h2>

<h3>Jenkins devops</h3>
<p>[youtube]</p>
Jenkins devops <a href="remmont.com">Top headlines</a> Jenkins devops
<h4>Jenkins devops</h4>
IBM® Cloud DevOps aggregates and provides visualizations of the indications of a continuous delivery project’s health. Use its built-in dashboards and data reporting services to learn where you most need to improve your build, test, and delivery processes. You can also define test coverage policies to prevent bad code from being promoted to critical environments.
<h5>Jenkins devops</h5>
Jenkins devops <a href="remmont.com">Jenkins devops</a> Jenkins devops
SOURCE: <h6>Jenkins devops</h6> <a href="dev-ops.engineer/">Jenkins devops</a> Jenkins devops
#tags#[replace: -,-Jenkins devops] Jenkins devops#tags#

Eduard Kabrinskiy
current news
  • SHEQELBoolo
  • SHEQELBoolo аватар
  • Немає на сайті
  • Платиновий учасник
  • Дописи: 3182
  • Репутація: 0
Адміністратор заборонив доступ на запис.
Час відкриття сторінки: 0.052 секунд