Travis CI Integration

Set up steps

First create an `anteater.conf in the root directory of your repository:

[config]
anteater_files = anteater_files/
reports_dir = %(anteater_files)s.reports/
anteater_log = %(anteater_files)s/.reports/anteater.log
flag_list =  %(anteater_files)s/flag_list.yaml
ignore_list = %(anteater_files)s/ignore_list.yaml

anteater_files

anteater_files is a location which anteater wil not scan.

The rationale about hiding this folder from anteater, is for the simple fact anteater will report on the strings it uses itself as a guide for what to search for.

reports_dir & anteater_log

You can leave these as is, its a logging location used for when running the tool locally.

flag_list & ignore_list

flag_list.yaml is where all regular expressions are set, that if matched will fail the build, thereby marking a failure on the pull request page.

Some examples can be found here.

For information on flag_list, please consult the User Guide

Travis Integration

All that is required now is to make the following entries to your yaml file:

language: python

python:
  - "2.7"

install:
  - pip install anteater

before_script:
  - git diff --name-only HEAD^ > ./patch
script:
  - anteater --project antest --patchset ./patch

Note

Should you be using another language other then python (for example ruby), you can use matrix:include

matrix:
  include:
    - language: python
      python:
        - "2.7"
        - "3.6"

      install:
        - pip install anteater

      before_script:
        - git diff --name-only HEAD^ > ./patch

      script:
        - anteater --project antest --patchset ./patch

    - language: ruby
    # your project travis elements go here.

An example .travis.yml can be found here.

Virus Total API KEY

Should you wish to use any of the Virus Total functionailty such as URL scanning, then please set your Virus Total Key as the environment variable VT_KEY in the “Environment Variables” section of your Travis CI job, see here. for complete details.

Developer Workflow

  1. Contributor forks , creates a branch

git checkout -b mypullrequest

  1. Contributor commits and makes pull request

git commit -m "My Pull Request" git push origin mypullrequest

  1. A pull request is then made on the Contributors github page.
  2. Travis CI runs anteater checks, checks fail.
  3. Contributor addresses the failure.

git commit -va -m "Correcting for anteater failures"

  1. Travis CI runs anteater again, and marks build as Passed.
  2. Main developer see’s test has passed, and merges Contributors pull request.