forked from openware/peatio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
73 lines (60 loc) · 3.04 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
dist: trusty
sudo: required
language: ruby
cache: bundler
env:
- RAILS_ENV=test
RAKE_ENV=test
DISPLAY=:0.0
BOT_USERNAME=kite-bot
BOT_NAME="Kite Bot"
services:
- mysql
- redis-server
- rabbitmq
- docker
addons:
chrome: stable
apt:
packages:
- nginx
hosts:
- peatio.local
# Execute all of the commands which need to be executed before installing dependencies.
before_install:
- gem install bundler
- . $HOME/.nvm/nvm.sh
- nvm install 8
- nvm use 8
- npm i -g yarn
- docker login -u peatioexchange -p $DOCKERHUB_PASSWORD || true # Don't let the build fail in case of broken authentication in Docker Hub.
# Execute all of the commands which should install application dependencies.
install:
- bundle install --deployment --without production development --jobs=$(nproc) --retry=3
- bundle exec rake yarn:install
# Pull existing layers from Docker Hub to skip building them. The speeds up Travis build a lot.
- docker pull peatioexchange/peatio:latest || true # In case image doesn't exist.
- docker pull rubykube/peatio-trading-ui:1.7.0
- docker run -d -p 4000:3000 -e "RAILS_ENV=production" -e "SECRET_KEY_BASE=secret" -e "PLATFORM_ROOT_URL=http://peatio.local" -e "RAILS_SERVE_STATIC_FILES=1" --add-host=peatio.local:$(ip addr show eth0 | grep -Po 'inet \K[\d.]+') --name=peatio-trading-ui rubykube/peatio-trading-ui:1.7.0
# Execute all of the commands which need to be executed before running actual tests.
before_script:
- ./bin/init_config
- ./bin/install_plugins
- bundle exec rake db:create db:migrate
- sudo cp ./ci/nginx/server.conf /etc/nginx/sites-enabled/default
- sudo nginx -s stop && sudo nginx
# Execute all of the commands which should make the build pass or fail.
script:
URL_HOST=peatio.local xvfb-run --auto-servernum --server-args="-screen 0 1280x800x16" bundle exec rspec &&
docker build --tag peatioexchange/peatio:latest --cache-from peatioexchange/peatio:latest .
# Execute all of the commands which need to be executed after the build passed.
# Don't let the ci/bump.rb don't run in case of issues with "docker push".
after_success: (docker push peatioexchange/peatio:latest || true) && ruby ci/bump.rb
# Execute all of the commands which need to be executed after the build failed.
after_failure:
notifications:
slack:
rooms:
- secure: tR80SJaiYgXX5MzArMGN+J2WM/9NpiIQ8kXqEPhXxr3H82L7w+JAzG9nz1iIgC4+WAhcAC0GPzMR9T+sJEqh5g7aOtSdubI2Edt6nxJULDtB1QicaLZYATesJ7auBDwmiHbxaeLAmh/qPzK2TETmYX4/xktMkApaZgvvruDHUHpffKN+fMbhuK+sDwcv9RCotjbLs+flCO3aSwAM8cyEV52/UncKBj1gEHHY+WVBDTfKO9kLSBMhZQrTLiYBi59GNthXr4Xi7wp0hQflN7KeRw0zNB4BpxylyfW05/loK7+CAecxDzS3dXkqgOT56fUu7FCdUXxTu/cPHr7mXdOxRRzpX80QC6+/vr+Kw58omXHuJG97g2j8O9LDJS3zfOBCgiIbw2e0sCtnamK5aNvpCNuPAoJ7w9MUGnkOYmR73zpGqrOeT8pbJu5QEcz5InzSjV/ym7ETBIrJSf1DZvxd52OPqDa8pVOHtg3MR43pO9ZW+E0YCea/UxoqDnPZb1yC3yJuVNeO1951Q0Tgr/oDar7yWTQMPuGyQ7jnrhl83CVSvYbGCNzA9psxAy2UjdwZf1WmiZofoO63XRIWdEmVHXnxZFEEsjB4r6R9yZRoqa909Z1+b1zFd+uJdQ1zQzsDgFxAH1FFSaEEiFtV9G0Xa8AFOgB7UYtCZsCXFCVid6Y=
on_success: change