mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-08-07 05:13:37 -04:00
Fixes #1099, or at least works around it, though a better solution would be to rewrite our deployment system using Travis build stages or Heroku build pipelines. The Elasticsearch job was picked because it's the one most likely to fail, and I can't work out how to deploy only if all three jobs pass.
74 lines
2.4 KiB
YAML
74 lines
2.4 KiB
YAML
sudo: required
|
|
language: ruby
|
|
cache:
|
|
bundler: true
|
|
directories:
|
|
- travis_phantomjs
|
|
- tmp/cache/assets/test/sprockets
|
|
env:
|
|
matrix:
|
|
- GROWSTUFF_ELASTICSEARCH='true' RSPEC_TAG=elasticsearch STATIC_CHECKS=false
|
|
- GROWSTUFF_ELASTICSEARCH='false' RSPEC_TAG=~elasticsearch STATIC_CHECKS=false
|
|
- STATIC_CHECKS=true
|
|
global:
|
|
- GROWSTUFF_SITE_NAME="Growstuff (travis)"
|
|
- RAILS_SECRET_TOKEN='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
|
- secure: "Z5TpM2jEX4UCvNePnk/LwltQX48U2u9BRc+Iypr1x9QW2o228QJhPIOH39a8RMUrepGnkQIq9q3ZRUn98RfrJz1yThtlNFL3NmzdQ57gKgjGwfpa0e4Dwj/ZJqV2D84tDGjvdVYLP7zzaYZxQcwk/cgNpzKf/jq97HLNP7CYuf4="
|
|
before_install:
|
|
- ./script/install_phantomjs;
|
|
- export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
|
|
# Force Travis to use Elastic Search 2.4.0
|
|
- >
|
|
if [ "${GROWSTUFF_ELASTICSEARCH}" = "true" ]; then
|
|
sudo dpkg -r elasticsearch;
|
|
curl -O https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.4.0/elasticsearch-2.4.0.deb;
|
|
sudo dpkg -i --force-confnew elasticsearch-2.4.0.deb;
|
|
sudo service elasticsearch start;
|
|
sleep 10;
|
|
curl localhost:9200;
|
|
fi
|
|
before_script:
|
|
- set -e
|
|
- >
|
|
if [ "${STATIC_CHECKS}" = "true" ]; then
|
|
./script/install_linters;
|
|
else
|
|
RAILS_ENV=test bundle exec rake db:create db:migrate;
|
|
bundle exec rake assets:precompile;
|
|
fi
|
|
- set +e
|
|
script:
|
|
- set -e
|
|
- >
|
|
if [ "${STATIC_CHECKS}" = "true" ]; then
|
|
./script/check_static.rb
|
|
else
|
|
bundle exec rake db:migrate --trace;
|
|
bundle exec rspec --tag $RSPEC_TAG spec/;
|
|
bundle exec rake jasmine:ci;
|
|
fi;
|
|
- set +e
|
|
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: 462e015bbdaabfb20910fc07f2fea253410ecb131444e00f97dbf32dc6789ca6
|