forked from Growstuff/growstuff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
68 lines (68 loc) · 2.25 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
sudo: required
language: ruby
cache:
bundler: true
directories:
- travis_phantomjs
- tmp/cache/assets/test/sprockets
env:
matrix:
- GROWSTUFF_ELASTICSEARCH=true RSPEC_TAG=elasticsearch COVERAGE=true
- GROWSTUFF_ELASTICSEARCH=false RSPEC_TAG=~elasticsearch COVERAGE=false
- STATIC_CHECKS=true
global:
- secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4="
- GROWSTUFF_SITE_NAME="Growstuff (travis)"
- RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
before_install:
- ./script/install_phantomjs.sh
- export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
- ./script/install_codeclimate.sh
- ./script/install_linters.sh
- VERSION="6.2.3" ./script/install_elasticsearch.sh
before_script:
- >
if [ "${COVERAGE}" = "true" ]; then
./cc-test-reporter before-build
fi
script:
- set -e
- >
if [ "${STATIC_CHECKS}" = "true" ]; then
./script/check_static.rb
else
set +e;
RAILS_ENV=test bundle exec rake db:create db:migrate search:create;
bundle exec rake assets:precompile;
bundle exec rspec --tag $RSPEC_TAG spec/;
fi;
- set +e
after_script:
- >
if [ "${COVERAGE}" = "true" ]; then
./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT;
fi
before_deploy:
- bundle exec script/heroku_maintenance.rb on
deploy:
provider: heroku
api_key:
secure: "WrQxf0fEKkCdXrjcejurobOnNNz3he4dDwjBbToXbQTQNDObPp7NetJrLsfM8FiUFEeOuvhIHHiDQtMvY720zGGAGxDptvgFS+0QHCUqoTRZA/yFfUmHlG2jROXTzk5uVK0AE4k6Ion5kX8+mM0EnMT/7u+MTFiukrJctSiEXfg="
on:
repo: Growstuff/growstuff
condition: "$RSPEC_TAG = elasticsearch"
app:
dev: growstuff-staging
master: growstuff-prod
travis_deploy: tranquil-basin-3130
travis_containers: tranquil-basin-3130
run:
- "rake db:migrate"
- "script/deploy-tasks.sh"
- restart
after_deploy:
- bundle exec script/heroku_maintenance.rb off
addons:
code_climate:
repo_token:
secure: "PfhLGBKRgNqhKuYCJsK+VPhdAzcgWFGeeOyxC/eS8gtlvIISVdgyZE+r30uIei0DFI6zEiN62eW4d+xtT4j7/e2ZcAcx7U52mza/SnQNuu3nCGQDJB8VOvV5NbnwXfi8vfr4e889Mt7k3ocd2c4gqB4UtRqrzhygj7HN+B/GfEk="