-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using local and parallel builds for Travis
- Loading branch information
Showing
1 changed file
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,41 @@ | ||
sudo: required | ||
language: ruby | ||
|
||
dist: trusty | ||
|
||
rvm: | ||
- 2.1.2 | ||
|
||
node_js: | ||
- "0.10.29" | ||
|
||
services: | ||
- docker | ||
- mysql | ||
|
||
install: | ||
- cp config/database.yml.example config/database.yml | ||
- cp config/config.yml.example config/config.yml | ||
- docker-compose build | ||
- docker-compose run web bundle exec bower install --allow-root | ||
- docker-compose run web bundle exec rake assets:precompile --trace | ||
- docker-compose run web bundle exec rake db:setup | ||
- bundle install | ||
- if [ $RAILS_ENV == 'production' ]; then | ||
mysql -e "CREATE DATABASE swbench;"; | ||
mysql -e "CREATE USER 'swbench'@'%' IDENTIFIED BY 'swbench';"; | ||
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'swbench'@'%';"; | ||
bundle exec rake db:schema:load; | ||
npm install -g bower; | ||
bower install --allow-root; | ||
else | ||
bundle exec rake db:create; | ||
bundle exec rake db:schema:load || bundle exec rake db:migrate; | ||
fi | ||
|
||
script: | ||
- docker-compose run web bundle exec rake test_all | ||
jobs: | ||
include: | ||
- name: "All Tests" | ||
script: bundle exec bundle exec rake test_all | ||
- name: "Docker Builds" | ||
script: docker build -t swbench . | ||
- name: "Asset Precompilation" | ||
env: | ||
- RAILS_ENV=production | ||
script: | ||
- bundle exec rake assets:precompile |