I just want to see if this works :P

- Removed launchy since I couldn't find any use of it
- Ruby 1.9 seems to need em-synchrony explictly
- No need to recreate the Gemfile.lock on Travis if proper :platforms
options are used in the Gemfile
- Removed group :development, :test and moved the stuff in the
corresponding sections
- Install adapter Gems according to the env var DB, install al if it is
unset
- Merged database.yml.postgres into database.yml.example. Bonus point:
easier switching between mysql and postgres
- May break everything but lets see what CI says
This commit is contained in:
Jonne Hass 2011-09-04 14:53:28 +02:00
parent 689fd7ec94
commit 835c4447f6
5 changed files with 45 additions and 51 deletions

24
Gemfile
View file

@ -1,8 +1,8 @@
source 'http://rubygems.org'
gem 'mysql2', '0.2.6'
gem 'pg'
#gem 'sqlite3'
gem 'mysql2', '0.2.6' if ENV['DB'].nil? || ENV['DB'] == "mysql"
gem 'pg' if ENV['DB'].nil? || ENV['DB'] == "postgres"
gem 'sqlite3' if ENV['DB'].nil? || ENV['DB'] == "sqlite"
gem 'rails', '3.0.9'
gem 'foreigner', '0.9.1'
gem 'activerecord-import'
@ -56,6 +56,7 @@ gem 'redcarpet', :git => 'git://github.com/tanoku/redcarpet'
#Websocket
gem 'em-websocket', :git => 'git://github.com/igrigorik/em-websocket', :ref => 'e278f5a1c4db60be7485'
gem 'em-synchrony', :platforms => :ruby_19
#File uploading
gem 'carrierwave', '0.5.2'
@ -87,30 +88,24 @@ group :development do
gem 'capistrano', '2.5.19', :require => false
gem 'capistrano-ext', '1.2.1', :require => false
gem 'sod', :git => "git://github.com/MikeSofaer/sod.git", :require => false
gem 'ruby-debug-base19', '0.11.23' if RUBY_VERSION.include? '1.9.1'
gem 'ruby-debug19', :platforms => :ruby_19
gem 'ruby-debug', :platforms => :mri_18
gem 'linecache', '0.43', :platforms => :mri_18
end
group :test, :development do
#gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
#gem 'guard-rspec'
gem 'factory_girl_rails', :require => false
unless ENV["TRAVIS"]
gem 'ruby-debug-base19', '0.11.23' if RUBY_VERSION.include? '1.9.1'
gem 'ruby-debug19', :platforms => :ruby_19
gem 'ruby-debug', :platforms => :mri_18
gem 'linecache', '0.43', :platforms => :mri_18
end
gem 'launchy'
gem 'jasmine', '1.1.0.rc3'
end
group :test do
gem 'mysql2', '0.2.6'
#gem 'pg'
gem 'factory_girl_rails'
gem 'fixture_builder', '0.2.2'
gem 'selenium-webdriver', '2.4'
gem 'capybara', '~> 0.3.9'
gem 'cucumber-rails', '0.3.2'
gem 'jasmine', '1.1.0.rc3'
gem 'rspec', '>= 2.0.0'
gem 'rspec-core', '2.6.0'
gem 'rspec-rails', '>= 2.0.0'
@ -118,7 +113,6 @@ group :test do
gem 'database_cleaner', '0.6.0'
gem 'webmock', :require => false
gem 'mongrel', :require => false, :platforms => :ruby_18
gem 'sqlite3', :require => false
gem 'rspec-instafail', '>= 0.1.7', :require => false
gem 'fuubar'

View file

@ -169,6 +169,8 @@ GEM
devise (~> 1.3.1)
rails (<= 3.2, >= 3.0.0)
diff-lcs (1.1.2)
em-synchrony (0.2.0)
eventmachine (>= 0.12.9)
erubis (2.6.6)
abstract (>= 1.0.0)
eventmachine (0.12.10)
@ -238,7 +240,6 @@ GEM
json_pure (1.5.3)
jwt (0.1.3)
json (>= 1.2.4)
launchy (2.0.3)
linecache (0.43)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
@ -476,6 +477,7 @@ DEPENDENCIES
devise (~> 1.3.1)
devise_invitable (= 0.5.0)
diaspora-client!
em-synchrony
em-websocket!
excon (= 0.2.4)
factory_girl_rails
@ -495,7 +497,6 @@ DEPENDENCIES
jasmine (= 1.1.0.rc3)
json (= 1.4.6)
jwt (= 0.1.3)
launchy
linecache (= 0.43)
mini_magick (= 3.2)
mongrel

View file

@ -1,11 +1,3 @@
# Remove Gemfile.lock and rebundle if we're on Ruby 1.9
ruby -e "system('rm Gemfile.lock') if RUBY_VERSION.include?('1.9')"
ruby -e "system('bundle install --without development production') if RUBY_VERSION.include?('1.9')"
# Create a database.yml for the right database
cp config/database.yml.example config/database.yml
ruby -e "system('cp config/ci/database.yml.postgresql config/database.yml') if ENV['DB'] == 'postgres'"
# adjust GC settings for REE
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
@ -13,14 +5,27 @@ export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
# Install firefox and start xvfb in preparation for cucumber & jasmine
sudo aptitude -q2 -y install firefox
# Install firefox
echo "Installing Firefox"
sudo aptitude -q3 -y install firefox
# Start xvfb in preparation for cucumber & jasmine
echo "Starting Xvfb"
sudo cp config/ci/xvfb /etc/init.d/xvfb
sh -e /etc/init.d/xvfb start
# Regenerate css files
sass --update public/stylesheets/sass/:public/stylesheets/
echo "Regenerate CSS files"
bundle exec sass -q --update public/stylesheets/sass/:public/stylesheets/
# Create a database.yml for the right database
echo "Setting up database.yml for $DB"
cp config/database.yml.example config/database.yml
if [ "$DB" = "postgres" ]; then
sed 's/<<: *mysql/<<: *postgres/' config/database.yml > config/database.yml
fi
# Set up database
echo "Creating databases for $DB and loading schema"
bundle exec rake db:create
bundle exec rake db:schema:load

View file

@ -1,20 +0,0 @@
common: &common
ejabbdb: ejabberd
encoding: unicode
adapter: postgresql
username: postgres
password:
port: 5432
host: localhost
development:
<<: *common
database: diaspora_development
production:
<<: *common
database: diaspora_production
test:
<<: *common
database: "diaspora_test"

View file

@ -1,13 +1,27 @@
common: &common
mysql: &mysql
adapter: mysql2
host: "localhost"
host: "localhost"
port: 3306
# socket: /tmp/mysql.sock
username: "root"
password: ""
# socket: /tmp/mysql.sock
charset: utf8
collation: utf8_bin
postgres: &postgres
adapter: postgresql
host: localhost
port: 5432
username: postgres
password:
encoding: unicode
common: &common
# Choose one of the following
<<: *mysql
#<<: *postgres
development:
<<: *common