# Travis CI

![TravisCI-Full-Color.png](https://assets.relyanceuat.xyz/images/docs/7768348401677/7767247946253.png)
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:

1. A source code repository needs to be available and connected to a Travis CI project.
2. The `relyance.yaml` file needs to be in the source code root directory.
3. Grab the command line code from **Step 2** of the Relyance Source Code Integration settings from *your* Relyance instance.

![Step-2.png](https://assets.relyanceuat.xyz/images/docs/7768348401677/15211242108301.png)

See more info about the SCI commands [**here**](#h_01GYWEA852TEZ9Y8BB32J16G6Y).

### Steps:

1. Go to the source code repository project in question (in Github/Bitbucket/etc).
2. If there is no config, setup the project and use the following yaml configuration:
```yaml
os: linux
language: generic

matrix:
  include:
    - name: Run Relyance AI
      services:
        - docker
      script:
        - docker pull gcr.io/relyance-ext/compliance_inspector:release && docker run --rm -v `pwd`:/repo --env 'API_KEY=example:abcdefg0123456789abcdefg0123456789abcdefg' gcr.io/relyance-ext/compliance_inspector:release
        - echo "Relyance Scan Complete"
```
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:
```yaml
os: linux
language: generic

matrix:
  include:
    - name: Echo Test
      script:
        - echo "Hello World"

    - name: Run Relyance AI
      services:
        - docker
      script:
        - docker pull gcr.io/relyance-ext/compliance_inspector:release && docker run --rm -v `pwd`:/repo --env 'API_KEY=example:abcdefg0123456789abcdefg0123456789abcdefg' gcr.io/relyance-ext/compliance_inspector:release
        - echo "Relyance Scan Complete"
```
3. Once complete, click save your Travis CI configuration file to the root of your repository.
4. Login to your Travis CI account.
5. Select your project and if not already running, trigger a build.
6. Go to your Dashboard to see your pipeline progress.
7. If there are no errors, you should start to see SCI results in your Relyance tenant.

![Travis_CI.png](https://assets.relyanceuat.xyz/images/docs/7768348401677/7768252115853.png)

### Appendix:

Source Code Integration **Step 2** info:

**Example Step 2 Command**

| 1 | docker pull  gcr.io/relyance-ext/compliance_inspector:release  && \ |
| --- | --- |
| 2 | docker run --rm -v `pwd`:/repo --env 'API_KEY= example :abcdefg0123456789abcdefg0123456789abcdefg'  gcr.io/relyance-ext/compliance_inspector:release |

1. This command pulls the latest version of the Relyance Source Code Inspector.
2. This command initiates the Relyance Source Code Inspector within a local Docker container, establishing a shared folder and providing the necessary tenant API credentials.
