|
| 1 | +os: linux |
1 | 2 | language: python
|
2 |
| - |
3 | 3 | python:
|
4 | 4 | - 2.7
|
5 | 5 |
|
6 |
| -sudo: required |
| 6 | +# no more required in travis |
| 7 | +#sudo: required |
7 | 8 |
|
8 | 9 | services:
|
9 | 10 | - docker
|
10 | 11 |
|
11 | 12 | jobs:
|
12 |
| - allow_failures: |
13 |
| - - env: CONFIG=3.0-apache LOGDIR=/var/log/apache2 |
14 |
| - - env: CONFIG=3.0-nginx LOGDIR=/var/log/nginx |
15 |
| - fast_finish: true |
16 | 13 | include:
|
17 |
| - - install: |
18 |
| - - pip install -r tests/integration/requirements.txt |
19 |
| - before_script: |
20 |
| - - git clone https://github.com/CRS-support/secrules_parsing |
21 |
| - - pip install -r secrules_parsing/requirements.txt |
22 |
| - - python secrules_parsing/secrules_parser.py -c -f rules/*.conf |
23 | 14 | script:
|
24 |
| - - py.test -vs tests/integration/format_tests.py |
25 |
| - - &test-common |
26 |
| - env: CONFIG=2.9-apache LOGDIR=/var/log/apache2 |
27 |
| - before_install: |
28 | 15 | - |
|
29 | 16 | if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
|
30 |
| - docker build --build-arg REPO=$TRAVIS_PULL_REQUEST_SLUG \ |
31 |
| - --build-arg BRANCH=$TRAVIS_PULL_REQUEST_BRANCH \ |
32 |
| - --build-arg COMMIT=$TRAVIS_PULL_REQUEST_SHA \ |
33 |
| - -f ./util/docker/Dockerfile-$CONFIG \ |
34 |
| - -t modsecurity-crs-$CONFIG ./util/docker/ |
| 17 | + docker run -ti --name crs-test --entrypoint /docker-entrypoint.sh -e REPO=$TRAVIS_PULL_REQUEST_SLUG -e BRANCH=$TRAVIS_PULL_REQUEST_BRANCH themiddle/crs-test |
35 | 18 | else
|
36 |
| - docker build -f ./util/docker/Dockerfile-$CONFIG \ |
37 |
| - -t modsecurity-crs-$CONFIG ./util/docker/ |
38 |
| - fi |
39 |
| - - | |
40 |
| - docker run -ti -e PARANOIA=5 -d -p 80:80 \ |
41 |
| - --volume $LOGDIR:$LOGDIR \ |
42 |
| - --name "$TRAVIS_BUILD_ID" modsecurity-crs-$CONFIG |
43 |
| - - | |
44 |
| - docker ps | grep -q modsecurity-crs |
45 |
| - if [[ $? -ne 0 ]]; then |
46 |
| - docker logs "$TRAVIS_BUILD_ID" |
47 |
| - docker rm -f "$TRAVIS_BUILD_ID" |
48 |
| - exit 1 |
| 19 | + docker run -ti --name crs-test --entrypoint /docker-entrypoint.sh -e REPO=$TRAVIS_REPO_SLUG -e BRANCH=$TRAVIS_BRANCH themiddle/crs-test |
49 | 20 | fi
|
50 |
| - install: |
51 |
| - - pip install -r tests/regression/requirements.txt |
52 |
| - script: |
53 |
| - - | |
54 |
| - py.test -vs tests/regression/CRS_Tests.py \ |
55 |
| - --config=$CONFIG --ruledir_recurse=tests/regression/tests |
56 |
| - - docker rm -f "$TRAVIS_BUILD_ID" |
57 |
| - - <<: *test-common |
58 |
| - env: CONFIG=3.0-apache LOGDIR=/var/log/apache2 |
59 |
| - - <<: *test-common |
60 |
| - env: CONFIG=3.0-nginx LOGDIR=/var/log/nginx |
61 | 21 |
|
62 | 22 | # safelist
|
63 | 23 | branches:
|
64 | 24 | only:
|
65 | 25 | - v3.1/dev
|
66 | 26 | - v3.2/dev
|
67 | 27 | - v3.3/dev
|
| 28 | + - fix-travis |
68 | 29 |
|
69 |
| -notifications: |
70 |
| - irc: "chat.freenode.net#modsecurity" |
| 30 | +#notifications: |
| 31 | +# irc: "chat.freenode.net#modsecurity" |
0 commit comments