Instructions for integrating TeamCity builds with ShiftLeft for code analysis and profiling.
To integrate TeamCity builds with ShiftLeft, please adhere to the following prerequisites:
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.
To integrate ShiftLeft with TeamCity builds:
Install the ShiftLeft CLI on the TeamCity host.
Create the following Environment variables in TeamCity:
SHIFTLEFT_ORG_ID| Value: Paste your Organization ID
SHIFTLEFT_UPLOAD_TOKEN| Value: Paste your Upload Token
To create a TeamCity job that executes SL commands:
Login to TeamCity.
Go to Project.
Go to General Settings > Build Configurations.
Select Build Step.
Add Build Step.
Configure the new build step as follows (see screenshot below):
Runner type: Select Command Line
Step name: SL Analyze (for example)
Execute step: Select If all previous steps finished successfully
Working directory: Enter
Run: Select Executable with parameters
Command executable: Enter
Save the configuration.
Run the build and verify analysis success in the command output.