mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-25 12:01:03 +00:00
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:
parent
41d95ef2fb
commit
6b5f2a0854
9 changed files with 39 additions and 9 deletions
|
@ -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
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -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'
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
5
Rakefile
5
Rakefile
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
22
lib/tasks/ci.rake
Normal 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
|
|
@ -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__)
|
||||
|
|
Loading…
Reference in a new issue