TeamCity
TeamCity is a cloud CI/CD service by JetBrains that is used to automatically build and test code projects. It combines continuous integration (CI) and continuous delivery (CD) to test and build your code and ship it to any target.
This how-to will provide a basic understanding of how add the Relyance Source Code inspector (SCI) into a typical build job.
Prerequisites:
- A source code repository needs to be available.
- The
relyance.yamlfile needs to be in the source code root directory. - Docker needs to be available in the scanning environment.
- Follow Set up SCI to create an OAuth credential and copy the Docker command from Step 2. Add
env.API_KEYas a Password parameter in the build configuration. For the examples on this page, setSCI_IMAGEin the scan environment to the full image reference shown at the end of that command. Tip: See more info about the SCI commands here.
Steps:
- Login to your TeamCity Account.
- Go to your project or create a new one.
- Click on Edit project... button in the top right-hand side.
- Under the Build Configurations section click the Create build configuration button.
- Select the desired repository in the wizard. Provide a meaningful name for your pipeline (e.g. Relyance Scan).

- This will bring you into the project build settings. Click on Build Steps in the left-hand navigation menu.
- Click the +Add build step button.
- This will open a list of potential build steps, use the Command Line step.
- Provide a meaningful Step name and enter the Step 2 command from your Relyance tenant into the Custom script box.

- Click Save.
- The default behaviour is to run a scan upon VCS trigger. If you wish to run this under a schedule instead, click Triggers from the left-hand navigation menu. Tip: It's suggested to delete the default VCS trigger since we are only concerned with the main branch.
- Click the +Add new trigger button.
- Select Schedule Trigger from the dropdown menu.

- In the resulting dialog set the schedule cadence and set the branch to your main or master branch in order to only scan the current default. Tip: It is recommended to always run a scan regardless of changes as the source code inspector is being consistently improved and can pick up new things periodically.
- Click Save to save your trigger schedule.
- Once complete, click the Run... button at the top of the page to do your first Relyance scan.
- If there are no errors, you should start to see SCI results in your Relyance tenant.
Appendix:
Run the command from the repository root with the scan job's API_KEY environment variable and the image from Step 2.
docker run --pull=always --rm --env API_KEY --volume "$PWD:/repo:ro" "$SCI_IMAGE"