forked from ruby-bench/ruby-bench-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
45 lines (43 loc) · 1.54 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
language: ruby
cache:
directories:
- vendor/bundle
- travis_phantomjs
- test/vcr_cassettes
sudo: false
rvm:
- "2.3.3"
notifications:
email: false
bundler_args: --without development:production --deployment --retry=3 --jobs=3
before_script:
- bundle exec rake db:create
- bundle exec rake db:migrate
- bundle exec rake assets:precompile &> /dev/null
before_install:
- "export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH"
- if [ $(phantomjs --version) != '2.1.1' ]; then
rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs;
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2;
tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs;
fi
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script:
- bundle exec rubocop
- bundle exec rake test
after_success:
- if [[ "$TRAVIS_BRANCH" = "production" && "$TRAVIS_EVENT_TYPE" = "push" ]]; then
openssl aes-256-cbc -K $encrypted_e5503b6e115e_key -iv $encrypted_e5503b6e115e_iv
-in deploy/deploy_rsa.enc -out /tmp/deploy_rsa -d;
eval "$(ssh-agent -s)";
chmod 600 /tmp/deploy_rsa;
ssh-add /tmp/deploy_rsa;
echo "\\nDeploying in progress ...";
ssh -o StrictHostKeyChecking=no root@$DEPLOY_HOST "exec &> deploy.log && ./deploy";
echo "\\nDeploy finished! Check deploy logs on server.";
fi
addons:
postgresql: "9.3"
services:
- redis-server