-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
45 lines (37 loc) · 2.13 KB
/
.travis.yml
File metadata and controls
45 lines (37 loc) · 2.13 KB
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
sudo: required
dist: xenial
language: python
python:
- "3.7"
services:
- docker
env:
global:
- LANDING_PAGE: "http://localhost:7474/db/data/"
before_install:
- docker run -d --name kb -p 7474:7474 -p 7687:7687 --env=NEO4J_AUTH=none --env=NEO4J_dbms_read__only=false --env=NEO4J_dbms_memory_heap_maxSize=1G --volume=$TRAVIS_BUILD_DIR/src/:/import/ virtualflybrain/docker-neo4j-knowledgebase
- sleep 45s
- echo -e "travis_fold:start:Checking_local_KB_connection" || true
- Test () { export http_status=$(curl -s -i $LANDING_PAGE | grep HTTP/1.1 | awk {'print $2'}); echo "Returned status \"$http_status\""; if [ "$http_status" != "200" ]; then echo "Waiting for neo4j to finish loading..."; iterations=$((iterations+1)); if [ "$iterations" != "100" ]; then sleep 1; Test; fi; else echo "$(date) - connected successfully"; fi; }
- Test
- if curl --head --silent --fail -u neo4j:neo4j $LANDING_PAGE 2> /dev/null; then
echo "NEO4J is running.";
else
echo -e "Server failed to start!\n\nLog:\n";
docker logs kb;
fi;
- echo -e "travis_fold:end:Checking_local_KB_connection" || true
- git clone https://github.com/VirtualFlyBrain/VFB_neo4j.git
- export PYTHONPATH=$PYTHONPATH:$TRAVIS_BUILD_DIR/VFB_neo4j/src/
- pwd
- export BUILD_TYPE=`if [[ "$TRAVIS_BRANCH" == *"_curation" ]]; then echo "curation"; elif [ "$TRAVIS_BRANCH" == "master" ]; then echo "master"; else echo "other"; fi`
- export BASEPATH=`if [ "$BUILD_TYPE" == "curation" ]; then echo "../records"; else echo "vfb/curation/test/resources/records"; fi`
install:
- pip install -r requirements.txt
- pip install -r VFB_neo4j/requirements.txt
- pip install ruamel.yaml # Hack for different package name on pip vs condaForge
script:
- cd src
- travis_wait 70 python -m vfb.curation.test.test_peevish
- if [ ! "$BUILD_TYPE" == "curation" ]; then travis_wait 70 python run_peevish.py --test_mode --base_path=$BASEPATH --import_filepath=$TRAVIS_BUILD_DIR/src/ http://localhost:7474 neo4j neo4j; fi ;
- travis_wait 70 python run_peevish.py --base_path=$BASEPATH http://localhost:7474 neo4j neo4j --verbose --import_filepath=$TRAVIS_BUILD_DIR/src/