-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
122 lines (108 loc) · 4 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
sudo: required
dist: trusty
language: ruby
cache:
bundler: true
directories:
- $HOME/system-test
rvm:
- 2.5.3
services:
- postgresql
notifications:
email: false
addons:
postgresql: '9.6'
apt:
packages:
- postgresql-server-dev-9.6
- git-svn
matrix:
fast_finish: true
allow_failures:
- env: JOB=system-test
include:
- env: JOB=seeds
services:
- rabbitmq
- elasticsearch
- postgresql
before_install:
- gem install bundler
- sudo rabbitmq-plugins enable rabbitmq_recent_history_exchange
- sudo rabbitmqctl add_vhost ontohub_development
- sudo rabbitmqctl set_permissions -p ontohub_development guest ".*" ".*" ".*"
before_script:
- |
echo "git_shell:" > config/settings.local.yml
echo " path: spec/support/git-shell" >> config/settings.local.yml
echo " copy_authorized_keys_executable: spec/support/git-shell-copy-authorized-keys" >> config/settings.local.yml
script:
- ping_elasticsearch="curl localhost:9200"; while (! $ping_elasticsearch > /dev/null 2> /dev/null); do sleep 0.1; done
- RAILS_ENV=development bundle exec rails db:recreate:seed
- env: JOB=rspec
services:
- elasticsearch
- postgresql
before_install:
- gem install bundler
before_script:
- RAILS_ENV=test bundle exec rails db:recreate
- ping_elasticsearch="curl localhost:9200"; while (! $ping_elasticsearch > /dev/null 2> /dev/null); do sleep 0.1; done
script:
- bundle exec rspec --format progress
- env: JOB=system-test
gemfile: $HOME/system-test/Gemfile
services:
- rabbitmq
- elasticsearch
- postgresql
before_install:
- gem install bundler
- sudo rabbitmq-plugins enable rabbitmq_recent_history_exchange
install:
- EMAJ_VERSION=2.1.0
- curl -Lo /tmp/emaj.zip http://api.pgxn.org/dist/e-maj/$EMAJ_VERSION/e-maj-$EMAJ_VERSION.zip
- EMAJ_TMPDIR=/tmp/emaj
- unzip /tmp/emaj.zip -d $EMAJ_TMPDIR/
- EMAJ_SQL_FILE=$EMAJ_TMPDIR/e-maj-$EMAJ_VERSION/sql/emaj--$EMAJ_VERSION.sql
- EMAJ_CONTROL_FILE=$EMAJ_TMPDIR/e-maj-$EMAJ_VERSION/emaj.control
- SHAREDIR=$(pg_config --sharedir)
- sudo mkdir -p $SHAREDIR/extension/
- sudo cp $EMAJ_SQL_FILE $EMAJ_CONTROL_FILE $SHAREDIR/extension/
before_script:
# Disable SSH host key checking for localhost (for testing the git-shell)
- echo "Host 127.0.0.1 localhost" > ~/.ssh/config
- echo " StrictHostKeyChecking no" >> ~/.ssh/config
- echo " UserKnownHostsFile /dev/null" >> ~/.ssh/config
- echo " User travis" >> ~/.ssh/config
- echo " IdentityFile ~/.ssh/self" >> ~/.ssh/config
# Create an SSH key and allow to connect with localhost (for testing the git-shell)
- ssh-keygen -t rsa -b 2048 -N '' -f ~/.ssh/self
- ls -la ~/.ssh
- cat ~/.ssh/self.pub > ~/.ssh/authorized_keys
- ssh travis@localhost echo "SSH setup complete"
# Set up RabbitMQ VirtualHost
- sudo rabbitmqctl add_vhost ontohub_system_test
- sudo rabbitmqctl set_permissions -p ontohub_system_test guest ".*" ".*" ".*"
# Set up the system-tests
- |
if [ -d $HOME/system-test/.git ]
then
pushd $HOME/system-test
git fetch
popd
else
git clone https://github.com/ontohub/system-test.git $HOME/system-test
fi
- pushd $HOME/system-test
- git checkout origin/master
- echo "Using system-test revision $(git log -1 --format=%H)"
- bundle install
- popd
- ping_elasticsearch="curl localhost:9200"; while (! $ping_elasticsearch > /dev/null 2> /dev/null); do sleep 0.1; done
script:
- pushd $HOME/system-test
- echo "Testing commit $TRAVIS_COMMIT"
- ONTOHUB_BACKEND_VERSION=$TRAVIS_COMMIT bundle exec rspec
- popd