forked from Netflix/security_monkey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
161 lines (143 loc) · 5.82 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# 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"
include:
##### LEGACY PYTHON UNIT TEST JOB #####
- dist: trusty
sudo: required
language: python
python: "2.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 "os-client-config==1.28.0"
- pip install "openstacksdk==0.9.18"
- pip install cloudaux\[gcp\]
- pip install cloudaux\[openstack\]
- pip install slackclient
- 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
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
#####################################################
##### PYTHON UNIT TEST JOB #####
# - dist: trusty
# sudo: required
# language: python
# python: "3.6"
#
# env:
# - UNIT_TEST_JOB=true
# - PIP_DOWNLOAD_CACHE=".pip_download_cache"
#
# 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 openstacksdk
# - pip install cloudaux\[gcp\]
# - pip install cloudaux\[openstack\]
# - python setup.py develop
# - 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
#
# 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 #####
- 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: trusty
env: DART_TEST=True
script: sh env_tests/test_dart.sh
#####################################################
cache:
directories:
- .pip_download_cache
notifications:
email: