Build Check for Salesforce

Build Check for Salesforce enables you to scan your code against three levels of controls: Salesforce best practices, industry standards, and Quality Clouds own recommendations. It helps you optimize the automation of your continuous quality and release management with centralized quality gates applied in Reposito

What is Build Check

Build Check is a continuous quality tool which automatically checks your code, and applies specified quality gates before you build and deploy. 


How it works

For every pull and merge request, Build Check checks the new code and returns the following results:

Success

The scan has finished, and the Quality Gates are PASSED or not configured. The pipeline continues with the process of building and deploying.

Fail 

The scan has finished, and the Quality Gates are FAILED. The pipeline stops the process of building and deploying.


Setting up an Azure DevOps pipeline for Salesforce

In case of using Azure DevOps as build orchestrator on top of a GitHub repository, the following sample would run quality check of the Salesforce metadata:


Azure DevOps Pipeline Sample for Salesforce
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- main

pool:
  vmImage: ubuntu-latest


steps:
- task: DockerInstaller@0
  inputs:
    dockerVersion: '17.09.0-ce'

- script: docker run --user root --network=host -v $BUILD_DIRECTORY:/src/:rw  -e QC_API_KEY=$QC_API_KEY -e API_URL=https://services.qualityclouds.com -e REPO_URL=https://github.com/qualityclouds-admin/test-action.git -e diff_mode=1 -e MODE=cloud -e URL_ID= -e BRANCH=test-pr -e OPERATION=PUSH -t qualityclouds/pipeline-salesforce sf-scan
  displayName: 'Scan'
  env:
    BUILD_DIRECTORY: $(Agent.BuildDirectory)
    QC_API_KEY: $(apiKey2)


Other Source Control Repositories

You can invoke Quality Clouds for Salesforce wrapper located in the Docker Hub library, as a generic container or as a Bitbucket one


What you'll need

You need to provide a valid API key to connect the Quality Clouds ruleset against which your code will be checked. To obtain an API key, contact your Quality Clouds admin. If you're an admin, check the Administering API keys article.





Last modified on Jul 27, 2022