forked from SpiderLabs/owasp-modsecurity-crs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
69 lines (63 loc) · 2.08 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
language: python
python:
- 2.7
sudo: required
services:
- docker
jobs:
allow_failures:
- env: CONFIG=3.0-apache LOGDIR=/var/log/apache2
- env: CONFIG=3.0-nginx LOGDIR=/var/log/nginx
fast_finish: true
include:
- &test-common
env: CONFIG=2.9-apache LOGDIR=/var/log/apache2
before_install:
- |
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
docker build --build-arg REPO=$TRAVIS_PULL_REQUEST_SLUG \
--build-arg BRANCH=$TRAVIS_PULL_REQUEST_BRANCH \
--build-arg COMMIT=$TRAVIS_PULL_REQUEST_SHA \
-f ./util/docker/Dockerfile-$CONFIG \
-t modsecurity-crs-$CONFIG ./util/docker/
else
docker build -f ./util/docker/Dockerfile-$CONFIG \
-t modsecurity-crs-$CONFIG ./util/docker/
fi
- |
docker run -ti -e PARANOIA=5 -d -p 80:80 \
--volume $LOGDIR:$LOGDIR \
--name "$TRAVIS_BUILD_ID" modsecurity-crs-$CONFIG
- |
docker ps | grep -q modsecurity-crs
if [[ $? -ne 0 ]]; then
docker logs "$TRAVIS_BUILD_ID"
docker rm -f "$TRAVIS_BUILD_ID"
exit 1
fi
install:
- pip install -r util/integration/requirements.txt
- pip install -r util/regression-tests/requirements.txt
before_script:
- git clone https://github.com/CRS-support/secrules_parsing
- pip install -r secrules_parsing/requirements.txt
- python secrules_parsing/secrules_parser.py -c -f rules/*.conf
script:
- py.test -vs util/integration/format_tests.py
- |
py.test -vs util/regression-tests/CRS_Tests.py \
--config=$CONFIG --ruledir_recurse=util/regression-tests/tests
- docker rm -f "$TRAVIS_BUILD_ID"
- <<: *test-common
env: CONFIG=3.0-apache LOGDIR=/var/log/apache2
- <<: *test-common
env: CONFIG=3.0-nginx LOGDIR=/var/log/nginx
# safelist
branches:
only:
- v3.0/dev
- v3.0/master
- v3.1/dev
- v3.2/dev
notifications:
irc: "chat.freenode.net#modsecurity"