Evaluating gates
IBM Cloud® DevOps Insights gates check whether your test results comply with a defined policy. If the policy is not met, the gate fails by default. You can also configure gates to act in an advisory role to allow pipeline progression even after failure.
Before you begin
Defining gates for Continuous Delivery
Place your gates before the build promotion in your pipeline to check the quality of the build against your policies. Policies ensure that it is safe to promote your application from one environment to the next.
After you create the policy, you can use the following script for gate evaluation:
#install the DevOps Insights plugin
ibmcloud plugin install -f doi
# Login to IBMCloud if you are not already logged in. Assumes that $API_KEY environment variable has been set as a secured property
ibmcloud login --apikey $API_KEY --no-region
# The following line assumes that MY_APP_NAME and MY_BUILD_NUMBER environment variables have already been set. POLICY is the name of the policy being evaluated.
ibmcloud doi gate-evaluate --logicalappname="$MY_APP_NAME" --buildnumber="$MY_BUILD_NUMBER" --policy "$POLICY_NAME"
Viewing gate evaluation
You can view the results of the gate evaluation on the Risk Analysis page, which relies on the presence of a gate after a staging deployment job in your pipeline. Make sure that you have a gate after you deploy to the staging environment, but before you deploy to a production environment.
- From the IBM Cloud console, click the Menu icon > Resource list.
- Select your toolchain.
- From your toolchain's Overview page, on the IBM Cloud tools card, click DevOps Insights.
- Click Risk Analysis in the navigation.
For more information about the Risk Analysis page, see Your deployment environments.