Update travis config to cache bundler

Fallback to older rails I18n behaviour
Silence deprecation warnings, for now
Added code climate test reporter
Created CI deployment task
Added *all* the badges
This commit is contained in:
Luke Barratt 2014-03-25 21:58:51 +00:00
parent 41d95ef2fb
commit 6b5f2a0854
9 changed files with 39 additions and 9 deletions

View file

@ -1,7 +1,10 @@
language: ruby
cache: bundler
rvm:
- 2.1.1
env:
- CODECLIMATE_REPO_TOKEN=b3db5b7df9a0a1d0fd3503e72d7431ffbfa172492c2840d590ccb2fafd9172d3
- MYSQL_USERNAME=travis
script:
- RAILS_ENV=test bundle exec rake db:create db:migrate db:test:prepare
- RAILS_ENV=test bundle exec rake db:create db:migrate db:test:prepare
- RAILS_ENV=test bundle exec rspec spec

View file

@ -37,6 +37,7 @@ end
group :test do
gem 'simplecov', '~> 0.7.1', require: false
gem 'codeclimate-test-reporter', '~> 0.3.0', require: nil
gem 'rspec-rails', '~> 2.14.1'
gem 'rspec-given', '~> 3.5.4'
gem 'capybara', '~> 2.2.1'

View file

@ -69,6 +69,8 @@ GEM
json (>= 1.7)
mime-types (>= 1.16)
cliver (0.3.2)
codeclimate-test-reporter (0.3.0)
simplecov (>= 0.7.1, < 1.0.0)
coderay (1.1.0)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
@ -254,6 +256,7 @@ DEPENDENCIES
capistrano3-unicorn (~> 0.1.1)
capybara (~> 2.2.1)
carrierwave (~> 0.10.0)
codeclimate-test-reporter (~> 0.3.0)
coffee-rails (~> 3.2.2)
dalli (~> 2.7.0)
dotenv-rails (~> 0.10.0)

View file

@ -1,6 +1,10 @@
[![Build Status](https://travis-ci.org/ENSL/ensl.org.svg?branch=master)](https://travis-ci.org/ENSL/ensl.org)
[![Code Climate](https://codeclimate.com/github/ENSL/ensl.org.png)](https://codeclimate.com/github/ENSL/ensl.org)
[![Code Climate](https://codeclimate.com/github/ENSL/ensl.org/coverage.png)](https://codeclimate.com/github/ENSL/ensl.org)
# ENSL Website
This is the source code of ENSL website. Currently deployed on [European NS League](http://www.ensl.org).
This is the source code of ENSL website. Currently deployed on [ensl.org](http://www.ensl.org).
Features:

View file

@ -1,8 +1,3 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake/dsl_definition'

View file

@ -38,6 +38,7 @@ module Ensl
# il8n fix
config.i18n.fallbacks = true
config.i18n.enforce_available_locales = false
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'

View file

@ -3,6 +3,5 @@ require 'verification'
require 'exceptions'
require 'extra'
ActiveSupport::Deprecation.silenced = true if ['staging', 'production'].include?(ENV['RAILS_ENV'])
ActiveSupport::Deprecation.silenced = true
Ensl::Application.initialize!

22
lib/tasks/ci.rake Normal file
View file

@ -0,0 +1,22 @@
namespace :ci do
task :deploy do
require 'rubygems'
require 'capistrano/all'
require 'capistrano/setup'
require 'capistrano/deploy'
if ci_branch = ENV['TRAVIS_BRANCH']
BRANCH_MAP = {
# 'master' => 'production'
'develop' => 'staging'
}
if BRANCH_MAP.include?(ci_branch)
Capistrano::Application.invoke(BRANCH_MAP[ci_branch])
Capistrano::Application.invoke("deploy")
end
else
raise "Failed to deploy: Rake task called outside of CI environment"
end
end
end

View file

@ -1,6 +1,8 @@
ENV["RAILS_ENV"] ||= 'test'
require 'codeclimate-test-reporter'
require 'simplecov'
CodeClimate::TestReporter.start
SimpleCov.start 'rails'
require File.expand_path("../../config/environment", __FILE__)