Travis CI
Travis CI is a hosted, distributed continuous integration service used to build and test software projects hosted on GitHub and Bitbucket.
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 and connected to a Travis CI project.
- The
relyance.yamlfile needs to be in the source code root directory. - Follow Set up SCI to create an OAuth credential and copy the Docker command from Step 2. Add
API_KEYas a protected environment variable in the repository settings. 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:
- Go to the source code repository project in question (in Github/Bitbucket/etc).
- If there is no config, setup the project and use the following yaml configuration:
os: linux
language: generic
matrix:
include:
- name: Run Relyance AI
services:
- docker
script:
- docker run --pull=always --rm --env API_KEY --volume "$PWD:/repo:ro" "$SCI_IMAGE"
- echo "Relyance Scan Complete"Note: Use the command line found in your source code integration Step 2. If there is already a configuration file, integrate the relevant commands into it:
os: linux
language: generic
matrix:
include:
- name: Echo Test
script:
- echo "Hello World"
- name: Run Relyance AI
services:
- docker
script:
- docker run --pull=always --rm --env API_KEY --volume "$PWD:/repo:ro" "$SCI_IMAGE"
- echo "Relyance Scan Complete"- Once complete, click save your Travis CI configuration file to the root of your repository.
- Login to your Travis CI account.
- Select your project and if not already running, trigger a build.
- Go to your Dashboard to see your pipeline progress.
- 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"