To integrate Jenkins builds with ShiftLeft and automate code analysis, configure each Jenkins project to execute the
sl analyze (or
sl analyze --cpg) shell command.
Edit the project build configuration and add the
Install the Hudson Post Build Task Plugin plugin and add the
The requirements for integrating Jenkins application builds are as follows:
Jenkins installation version 2.78 or later
Supported application and build tool (see code analysis requirements)
Familiarity with ShiftLeft Workflow
ShiftLeft account credentials: Organization ID and Upload Token
Initially these credentials will be provided to you by ShiftLeft. Once you have established your account you can copy them from the My Profile page at the ShiftLeft Dashboard.
Install the ShiftLeft CLI on the host where Jenkins is installed.
Log in to Jenkins as an administrator.
Select Manage Jenkins > Configure System > Global properties.
Select (check) Environment variables and create the following:
SHIFTLEFT_ORG_ID| Value: Paste your Organization ID
SHIFTLEFT_UPLOAD_TOKEN| Value: Paste your Upload Token
Test and verify Jenkins integration.
For basic Jenkins administration you can set and inject build env vars as described above. For advanced Jenkins administration, you can use Jenkins secret store to inject the ShiftLeft credentials into builds. Refer to the Jenkins documentation for details.