-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
74 lines (67 loc) · 2.66 KB
/
.travis.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# -*- coding: utf-8 -*-
#
# This file is part of B2SHARE.
# Copyright (C) 2017 University of Tübingen, CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
notifications:
email: false
dist: trusty
sudo: required
language: node_js
node_js:
- "7.10"
addons:
hosts:
- b2share.local
before_install:
- cd ${TRAVIS_BUILD_DIR}
- git clone https://github.com/EUDAT-B2SHARE/b2share.git
# - git clone https://github.com/EUDAT-B2SHARE/dockerize.git
- export B2SHARE_DATADIR=${TRAVIS_BUILD_DIR}/b2share-data
- export B2SHARE_JSONSCHEMAS_HOST=b2share.local
- export B2SHARE_SECRET_KEY=L2dWBTorUTQq1XSuiwofpmGYZZ
- export B2SHARE_RABBITMQ_USER=userrabbit
- export B2SHARE_RABBITMQ_PASS=passrabbit
- export B2SHARE_POSTGRESQL_USER=userpostgres
- export B2SHARE_POSTGRESQL_PASSWORD=passpostgres
- export B2SHARE_POSTGRESQL_DBNAME=invenio
- export USE_STAGING_B2ACCESS=1
- export INIT_DB_AND_INDEX=1
- export LOAD_DEMO_COMMUNITIES_AND_RECORDS=1
install:
### Build docker image for B2SHARE (nightly)
# - cd ${TRAVIS_BUILD_DIR}/b2share
# - docker build . -f dockerize/Dockerfile -t b2share-packagetest
# - cd ${TRAVIS_BUILD_DIR}/dockerize
# - "sed -r 's/^(\s*)(image\s*:\s*eudatb2share/b2share:.*$)/\1image: b2share-packagetest/' docker-compose.yml"
- cd ${TRAVIS_BUILD_DIR}/b2share/dockerize
- docker-compose pull
- docker-compose build
### Build docker image for npmtest
- cd ${TRAVIS_BUILD_DIR}/npmtest
- mv ${TRAVIS_BUILD_DIR}/b2share/webui/src/__tests__ .
- docker build . -t npmtest
before_script:
### Start B2SHARE
- cd ${TRAVIS_BUILD_DIR}/b2share/dockerize
- docker-compose up -d
### Wait for B2SHARE
- cd ${TRAVIS_BUILD_DIR}
- until $(curl -sfk -o /dev/null https://b2share.local/api/); do printf '.'; sleep 5; done
- curl -sfk https://b2share.local/api/
script:
- export IP_ADDR=$(ip addr show eth0 | awk '/inet / {print $2}' | cut -d'/' -f1)
- docker run --add-host b2share.local:$IP_ADDR -e "AUTOTEST_USER=$AUTOTEST_USER" -e "AUTOTEST_PASS=$AUTOTEST_PASS" -e "AUTOTEST_EMAIL=$AUTOTEST_EMAIL" npmtest