This repository has been archived by the owner on Sep 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 800
/
.travis.yml
100 lines (83 loc) · 3.45 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Travis YAML file for Security Monkey.
# Only way to get multiple builds to work without having the "default" job working was to
# duplicate everything :/ See: https://github.com/travis-ci/travis-ci/issues/4681
matrix:
# allow_failures:
# - python: "3.6"
#####################################################
##### PYTHON UNIT TEST JOB #####
- dist: Bionic
sudo: required
language: python
python: "3.7"
env:
- UNIT_TEST_JOB=true
- PIP_DOWNLOAD_CACHE=".pip_download_cache"
- SECURITY_MONKEY_SETTINGS="$( pwd )/env-config/config.py"
addons:
postgresql: "9.4"
before_script:
- psql -c "CREATE DATABASE secmonkey;" -U postgres
- psql -c "CREATE ROLE securitymonkeyuser LOGIN PASSWORD 'securitymonkeypassword';" -U postgres
- psql -c "CREATE SCHEMA secmonkey GRANT Usage, Create ON SCHEMA secmonkey TO securitymonkeyuser;" -U postgres
- psql -c "set timezone TO 'GMT';" -U postgres
- pip install pip --upgrade
- pip install setuptools --upgrade
- pip install google-compute-engine
- pip install oauth2client
- pip install google-api-python-client
- pip install httplib2
- pip install cloudaux\[gcp\]
- pip install cloudaux\[openstack\]
- pip install -e .
- pip install ."[tests]"
- pip install coveralls
- monkey db upgrade
- monkey amazon_accounts
before_install:
- sudo mkdir -p /var/log/security_monkey/
- sudo touch /var/log/security_monkey/securitymonkey.log
- sudo chown travis /var/log/security_monkey/securitymonkey.log
install:
- sed -i '/WTF_CSRF_ENABLED = True/c\WTF_CSRF_ENABLED = False' `pwd`/env-config/config.py
- pip install bandit
- pip install pylint
- pip install flake8
- pip install coverage==5.0.3
script:
- coverage run -a -m py.test security_monkey/tests/auditors || exit 1
- coverage run -a -m py.test security_monkey/tests/watchers || exit 1
- coverage run -a -m py.test security_monkey/tests/core || exit 1
- coverage run -a -m py.test security_monkey/tests/scheduling || exit 1
- coverage run -a -m py.test security_monkey/tests/views || exit 1
- coverage run -a -m py.test security_monkey/tests/interface || exit 1
- coverage run -a -m py.test security_monkey/tests/utilities || exit 1
- bandit -r -ll -ii -x security_monkey/tests .
- pylint -E -d E1101,E0611,F0401 --ignore=service.py,datastore.py,datastore_utils.py,watcher.py,test_celery_scheduler.py security_monkey
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
after_success:
- coveralls
- coverage report
#####################################################
##### BUILD DOCKER CONTAINER JOB #####
- dist: Bionic
sudo: required
env:
- BUILD_DOCKER=True
- DOCKER_COMPOSE_VERSION=1.18.0
- PIP_DOWNLOAD_CACHE=".pip_download_cache"
- SECURITY_MONKEY_SETTINGS="$( pwd )/env-config/config.py"
services:
- docker
script:
- docker-compose --version
- docker-compose build
#####################################################
##### TEST DART JOB #####
- dist: Bionic
env: DART_TEST=True
script: sh env_tests/test_dart.sh
#####################################################
cache:
directories:
- .pip_download_cache