-
Notifications
You must be signed in to change notification settings - Fork 8
Travis CI Integration
Ochrona Security edited this page Dec 9, 2019
·
2 revisions
This guide will show you how to include Ochrona CLI into your CI/CD process using Travis-ci.
- Get an Ochrona API key if you don't already have one from Ochrona.dev.
- (Optional) If you don't already have travis-ci configured for your project, I'd suggest following this guide - https://docs.travis-ci.com/user/tutorial/
- Add your Ochrona API key as an environment variable in travis-ci.
- On the right side of your build page click the
More Options
button and selectSettings
from the dropdown. - Scroll down the Settings menu until you reach the
Environment Variables
section. Create a new environment variable namedOCHRONA_API_KEY
and set the value to equal your API key from step #1. Add the variable.
- On the right side of your build page click the
- In your
travis.yml
file, add the following step to thescripts
section- ochrona
. Note if you only want to check a specific dependency file you can add the--file
option. There are also multiple other options available to tailer your build process.
language: python
python:
- 3.6
install:
- python --version
- pip install -U pip
- pip install pipenv
- pipenv install --dev
script:
- pytest ./tests
- ochrona --file ./Pipfile.lock