MISP-Taxii-Server/.travis.yml

43 lines
1.4 KiB
YAML

sudo: required
language: python
python:
- "3.5"
- "3.6"
services:
- mysql
- docker
env:
- OPENTAXII_CONFIG=$TRAVIS_BUILD_DIR/config/config.travis.yaml URL="http://localhost" APIKEY=testmispapikeytestmispapikeytestmispapik
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
- pip install -r REQUIREMENTS.txt
- python setup.py install
- docker pull floatingghost/misp-testable:v2.4.102
- docker run -d -p 80:80 floatingghost/misp-testable:v2.4.102
install:
# Check the config is ok
- echo $OPENTAXII_CONFIG
- mysql --version
#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
# 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-sync-data config/data-configuration.yaml
script:
- opentaxii-run-dev &
- pid=$!
- sleep 15
- taxii-push --path http://127.0.0.1:9000/services/inbox -f test/test.xml --dest my_collection --username admin --password admin
- kill -s INT $pid