CodeScan with Linux/Unix Agents
To fail a Jenkins job based on the outcome of your Quality gate takes a bit of setting up but is a great way to track the health of your projects from Jenkins. This is achieved with our SFDX plugin.
Requirements
You will need:
Jenkins
Setup Jenkins
In Jenkins, create a credential containing your CodeScan security token (learn how to find security token here).
Create a new Pipeline.
In the Pipeline script section you will need to paste in the code with the highlighted variables changed, these are:
Your credential_name should be the name of the credential you created.
my_project should be the project key you would like to assign to your project (learn how to find project key here).
my_organization should be your Organization Key (learn how to find organization key here).
Run the pipeline. If everything is set up correctly and your Quality Gate passes, you will be able to see you pipeline pass.
If your Quality Gate fails, you will see the error in the CodeScan stage of the build.
Last updated