Setting consistent parameter values
As part of integrating IBM® Continuous Delivery Pipeline for IBM Cloud® with IBM Cloud® DevOps Insights, you set consistent parameter values to publish data to DevOps Insights.
DevOps Insights tracks deployment risk based on published test data. When you integrate DevOps Insights with your Delivery Pipeline, you are instrumenting DevOps Insights to gather information from the pipeline. Information that is gathered from the pipeline is presented in DevOps Insights dashboard to provide visibility into your DevOps process.
Before you begin
Configure Delivery Pipeline in your toolchain to build, test, and deploy. You must complete this step before you continue with the integration. For more information, see Configuring Delivery Pipeline.
You need an API key to integrate with DevOps Insights. This API key has access to the toolchain, and is used to log in with the IBM Cloud® command line interface (CLI). For more information, see Managing user API keys.
Install the IBM Cloud CLI. For more information, see Getting started with the IBM Cloud CLI}}.
Setting environment properties
Use the logicalappname
and buildnumber
parameters consistently for publishing data to DevOps Insights or for evaluating policies. To set logicalappname
and buildnumber
values consistently across
pipeline stages, you need to set two properties in environment properties in the stage where you do the build.
The values of MY_APP_NAME
and MY_BUILD_NUMBER
are used in all stages. Use these values when you are integrating with Continuous Delivery. For example, set MY_APP_NAME
to My First App
and set
MY_BUILD_NUMBER
to $BRANCH:$BUILD_NUMBER
.
Configure your pipeline to use these properties across all stages. Save these properties to the build.properties
file in your build job and use the following script.
echo "MY_APP_NAME=${MY_APP_NAME}" >> $ARCHIVE_DIR/build.properties
echo "MY_BUILD_NUMBER=${MY_BUILD_NUMBER}" >> $ARCHIVE_DIR/build.properties
Setting environment properties within your delivery pipeline
Next, on the pipeline configuration page, set a property with name buildProperties
and the value build.properties
. You must set the property name and the value for each stage in your pipeline.
- From the IBM Cloud console, click the menu icon , and select Resource List.
- Select your toolchain.
- From your toolchain's Overview page, on the Delivery pipelines card, click the pipeline that you want to use.
- Click the Settings icon > Configure Stage.
- Select the Environment properties tab.
- If your API key isn't listed, click + Add property > Secure property, and add your API key.
- Click + Add property > Properties file.
- Enter
buildProperties
as the name andbuild.properties
as the value. - Click Save.