2013-11-11 23:18:13 +01:00
|
|
|
language: php
|
2016-07-01 14:43:06 +02:00
|
|
|
|
2013-11-11 23:18:13 +01:00
|
|
|
php:
|
2015-09-11 19:23:20 +02:00
|
|
|
- 5.6
|
2016-01-11 12:13:28 +01:00
|
|
|
- 7.0
|
2017-07-17 11:11:38 +02:00
|
|
|
- 7.1
|
2016-06-02 16:52:03 +02:00
|
|
|
- nightly
|
2013-11-12 16:23:37 +01:00
|
|
|
|
2015-09-07 00:40:47 +02:00
|
|
|
services:
|
2015-09-11 19:23:20 +02:00
|
|
|
- redis
|
2013-11-12 16:23:37 +01:00
|
|
|
|
2016-01-04 18:11:56 +01:00
|
|
|
sudo: required
|
|
|
|
dist: trusty
|
|
|
|
group: edge
|
2015-09-07 00:40:47 +02:00
|
|
|
|
|
|
|
addons:
|
2017-07-17 11:11:38 +02:00
|
|
|
mariadb:
|
|
|
|
- '10.0'
|
2015-09-11 19:23:20 +02:00
|
|
|
hosts:
|
|
|
|
- misp.local
|
2015-09-12 22:23:07 +02:00
|
|
|
- localhost
|
2015-09-07 00:40:47 +02:00
|
|
|
apt:
|
|
|
|
packages:
|
2016-12-07 11:56:47 +01:00
|
|
|
- python3-dev
|
|
|
|
- python3-pip
|
2018-04-30 18:27:40 +02:00
|
|
|
- python3-nose
|
2015-09-07 00:40:47 +02:00
|
|
|
- libxml2-dev
|
2018-04-30 18:27:40 +02:00
|
|
|
- libzmq3-dev
|
2015-09-07 00:40:47 +02:00
|
|
|
- zlib1g-dev
|
2015-09-11 19:23:20 +02:00
|
|
|
- apache2
|
|
|
|
- curl
|
2015-09-12 22:23:07 +02:00
|
|
|
- php5-mysql
|
2017-07-17 11:11:38 +02:00
|
|
|
- php5-dev
|
|
|
|
- php5-cli
|
|
|
|
- libapache2-mod-php5
|
2013-11-12 16:23:37 +01:00
|
|
|
|
2016-01-12 15:18:51 +01:00
|
|
|
|
|
|
|
before_install:
|
|
|
|
- git config --global user.name "TravisCI"
|
|
|
|
|
2015-09-11 19:23:20 +02:00
|
|
|
install:
|
2018-04-30 18:27:40 +02:00
|
|
|
- pip3 install --user --upgrade -r requirements.txt
|
2015-09-11 19:23:20 +02:00
|
|
|
- phpenv rehash
|
|
|
|
- pushd app
|
2016-06-02 16:52:03 +02:00
|
|
|
- composer install
|
2015-09-11 19:23:20 +02:00
|
|
|
- popd
|
2015-09-07 00:40:47 +02:00
|
|
|
- phpenv config-add travis/myphpconfig.ini
|
2015-09-11 19:23:20 +02:00
|
|
|
- cp -fa INSTALL/setup/config.php app/Plugin/CakeResque/Config/config.php
|
2016-01-04 18:11:56 +01:00
|
|
|
# Set perms
|
|
|
|
- sudo chown -R www-data:www-data `pwd`
|
|
|
|
- sudo chmod -R 755 `pwd`
|
|
|
|
- sudo chmod -R g+ws `pwd`/app/tmp
|
|
|
|
- sudo chmod -R g+ws `pwd`/app/tmp/cache
|
|
|
|
- sudo chmod -R g+ws `pwd`/app/tmp/cache/persistent
|
|
|
|
- sudo chmod -R g+ws `pwd`/app/tmp/cache/models
|
|
|
|
- sudo chmod -R g+ws `pwd`/app/tmp/logs
|
|
|
|
- sudo chmod -R g+ws `pwd`/app/files
|
|
|
|
- sudo chmod -R g+ws `pwd`/app/files/scripts/tmp
|
|
|
|
# Resque perms
|
|
|
|
- sudo chown -R www-data:www-data `pwd`/app/Plugin/CakeResque/tmp
|
|
|
|
- sudo chmod -R 755 `pwd`/app/Plugin/CakeResque/tmp
|
|
|
|
# install MySQL
|
|
|
|
- sudo chmod -R 777 `pwd`/INSTALL
|
2015-09-22 10:57:08 +02:00
|
|
|
- mysql -u root -e 'create database misp;'
|
|
|
|
- mysql -u root -e "grant usage on *.* to misp@localhost identified by 'blah'";
|
|
|
|
- mysql -u root -e "grant all privileges on misp.* to misp@localhost;"
|
|
|
|
- mysql -u misp -pblah misp < INSTALL/MYSQL.sql
|
2016-01-04 18:11:56 +01:00
|
|
|
# configure apache virtual hosts
|
|
|
|
- sudo chmod -R 777 `pwd`/build
|
|
|
|
- sudo cp -f build/travis-ci-apache /etc/apache2/sites-available/misp.local.conf
|
|
|
|
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/misp.local.conf
|
|
|
|
- sudo a2dissite 000-default
|
|
|
|
- sudo a2ensite misp.local.conf
|
|
|
|
- sudo a2enmod rewrite
|
|
|
|
- sudo service apache2 restart
|
|
|
|
# MISP configuration
|
|
|
|
- sudo chmod -R 777 `pwd`/travis
|
|
|
|
- sudo cp travis/bootstrap.php app/Config/bootstrap.php
|
|
|
|
- sudo cp travis/database.php app/Config/database.php
|
|
|
|
- sudo cp travis/core.php app/Config/core.php
|
|
|
|
- sudo cp travis/config.php app/Config/config.php
|
|
|
|
# Ensure the perms
|
|
|
|
- sudo chown -R www-data:www-data `pwd`/app/Config
|
|
|
|
- sudo chmod -R 750 `pwd`/app/Config
|
|
|
|
# GPG setup
|
|
|
|
- sudo mkdir `pwd`/.gnupg
|
|
|
|
# /!\ VERY INSECURE BUT FASTER ON THE BUILD ENV OF TRAVIS
|
|
|
|
- sudo cp -a /dev/urandom /dev/random
|
|
|
|
- sudo gpg --homedir `pwd`/.gnupg --gen-key --batch `pwd`/travis/gpg
|
|
|
|
- sudo chown www-data:www-data `pwd`/.gnupg
|
|
|
|
- sudo chmod 700 `pwd`/.gnupg
|
|
|
|
# Get authkey
|
|
|
|
- sudo usermod -a -G www-data $USER
|
|
|
|
- sudo -E su $USER -c 'app/Console/cake userInit -q | sudo tee ./key.txt'
|
|
|
|
- sudo chmod 777 ./key.txt
|
2016-01-12 15:18:51 +01:00
|
|
|
- sudo chmod -R 777 ./tests
|
2016-01-04 18:11:56 +01:00
|
|
|
- sudo chown -R www-data:www-data `pwd`
|
|
|
|
- sudo chmod +x /home/travis/build
|
|
|
|
- sudo chmod +x /home/travis
|
|
|
|
- sudo chmod +x /home
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- curl http://misp.local
|
|
|
|
- AUTH=`cat key.txt`
|
|
|
|
- sudo chmod -R 777 PyMISP
|
2015-09-22 10:57:08 +02:00
|
|
|
- pushd PyMISP
|
|
|
|
- echo 'url = "http://misp.local"' >> tests/keys.py
|
|
|
|
- echo 'key = "'${AUTH}'"' >> tests/keys.py
|
|
|
|
- cat tests/keys.py
|
|
|
|
- popd
|
2013-11-14 12:43:31 +01:00
|
|
|
|
|
|
|
script:
|
2016-01-12 15:18:51 +01:00
|
|
|
- pushd tests
|
|
|
|
- ./curl_tests.sh $AUTH
|
|
|
|
- popd
|
2015-09-22 10:57:08 +02:00
|
|
|
- pushd PyMISP
|
2017-07-17 11:11:38 +02:00
|
|
|
- pip3 install --user .
|
2018-01-08 12:14:10 +01:00
|
|
|
- nosetests --with-coverage --cover-package=pymisp tests/test_*.py
|
2016-12-07 11:56:47 +01:00
|
|
|
- python3 tests/test.py
|
2016-01-04 18:11:56 +01:00
|
|
|
- popd
|
2016-07-01 14:00:05 +02:00
|
|
|
- cp PyMISP/tests/keys.py PyMISP/examples/events/
|
|
|
|
- pushd PyMISP/examples/events/
|
2016-12-07 11:56:47 +01:00
|
|
|
- python3 ./create_massive_dummy_events.py -l 5 -a 30
|
2016-07-01 14:00:05 +02:00
|
|
|
- popd
|
2016-01-04 18:11:56 +01:00
|
|
|
|
|
|
|
after_failure:
|
|
|
|
- curl http://misp.local
|
|
|
|
- cat /etc/apache2/sites-available/misp.local.conf
|
|
|
|
- sudo ls -l /var/log/apache2
|
|
|
|
- sudo cat `pwd`/app/tmp/logs/error.log
|
|
|
|
- sudo cat `pwd`/app/tmp/logs/debug.log
|
|
|
|
- sudo cat /var/log/apache2/error.log
|
|
|
|
- sudo cat /var/log/apache2/misp.local_error.log
|
|
|
|
- sudo cat /var/log/apache2/misp.local_access.log
|
|
|
|
- pwd
|
|
|
|
|
2016-06-08 11:38:58 +02:00
|
|
|
notifications:
|
|
|
|
webhooks:
|
|
|
|
urls:
|
|
|
|
- https://webhooks.gitter.im/e/05e30284086a8e948d31
|
|
|
|
on_success: change # options: [always|never|change] default: always
|
|
|
|
on_failure: always # options: [always|never|change] default: always
|
|
|
|
on_start: never # options: [always|never|change] default: always
|
2015-09-22 16:40:35 +02:00
|
|
|
|
|
|
|
after_success:
|
|
|
|
- coveralls
|
2015-10-29 06:45:33 +01:00
|
|
|
- coverage report
|
|
|
|
- coverage xml
|
2017-07-17 11:11:38 +02:00
|
|
|
- codecov
|