MISP-Taxii-Server/.travis.yml

56 lines
1.6 KiB
YAML

dist: trusty
sudo: required
language: python
python:
- "3.5"
- "nightly"
services:
- mysql
env:
- OPENTAXII_CONFIG=$TRAVIS_BUILD_DIR/config/config.travis.yaml URL="http://35.163.95.230" APIKEY=pF4Rq3JOHbYAJLMiFDqRPpLxAh3s0PakiSPKWSN5
before_install:
- sudo apt-get install mysql-server-5.6 mysql-client-core-5.6 mysql-client-5.6 libxml2-dev libxslt1-dev zlib1g-dev
- wget "https://github.com/TAXIIProject/libtaxii/archive/1.1.111.tar.gz"
- tar xf 1.1.111.tar.gz
- cd libtaxii-1.1.111
- pip install -r requirements.txt
- python setup.py install
- cd ..
install:
# Check the config is ok
- echo $OPENTAXII_CONFIG
- mysql --version
# Set up the deps
- git submodule init
- git submodule update
#Configure hooks
- <misp_taxii_hooks/hooks.py sed 's@\[URL\]@'"$URL"'@; s@\[APIKEY\]@'"$APIKEY"'@' > misp_taxii_hooks/hooks.py
- head -n20 misp_taxii_hooks/hooks.py
- python setup.py install
# Install OpenTAXII
- cd OpenTAXII
- python setup.py install
- cd ..
# Create databases
- mysql -u root -e 'create database taxiiauth; create database taxiipersist;'
- mysql -u root -e "grant all on taxiiauth.* to 'taxii'@'%' identified by 'some_password';"
- mysql -u root -e "grant all on taxiipersist.* to 'taxii'@'%' identified by 'some_password';"
# Populate databases
- opentaxii-create-services -c config/services.yaml
- opentaxii-create-collections -c config/collections.yaml
- opentaxii-create-account -u travis -p travis
script:
- opentaxii-run-dev &
- pid=$!
- sleep 15
- cd tests
- nosetests .
- cd ..
- kill -s INT $pid