Permalink
Browse files

Merge branch 'master' into linkshortener

  • Loading branch information...
2 parents 2b95f9c + 5599fab commit 7187d597f5ce2b53b276c8800cf638a1897b9623 @joshk joshk committed Jan 18, 2012
View
@@ -1,3 +1,4 @@
config/travis.yml
play/*
log/*
+Gemfile.lock
View
@@ -1,6 +1,6 @@
rvm:
- 1.9.2
- - jruby
+ - jruby-18mode
before_script:
- 'RAILS_ENV=test bundle exec rake db:create db:schema:load --trace'
notifications:
View
@@ -5,7 +5,8 @@ gemspec
gem 'travis-support', :git => 'git://github.com/travis-ci/travis-support.git'
platform :mri do
- gem 'amqp', '~> 0.8.3'
+ gem 'amq-client', '>= 0.9.0'
+ gem 'amqp', '>= 0.9.0'
gem 'pg', '~> 0.11.0'
gem 'silent-postgres', '~> 0.1.1'
end
@@ -22,9 +23,10 @@ group :development do
end
group :test do
- gem 'rspec', '~> 2.7.0'
+ gem 'rspec', '~> 2.8.0'
gem 'factory_girl', '~> 2.3.2'
- gem 'database_cleaner', '~> 0.7.0'
+ # 0.7.1 has updated PG gem or something, breaks JRuby
+ gem 'database_cleaner', '= 0.7.0'
gem 'mocha', '~> 0.10.0'
gem 'webmock', '~> 1.7.7'
end
View
@@ -1,247 +0,0 @@
-GIT
- remote: git://github.com/travis-ci/travis-support.git
- revision: adab4cfe8881d8a46150702957c335b8449c9649
- specs:
- travis-support (0.0.1)
-
-PATH
- remote: .
- specs:
- travis-core (0.0.1)
- actionmailer_inline_css (~> 1.4.0)
- data_migrations (~> 0.0.1)
- devise (~> 1.5.0)
- hashr (~> 0.0.19)
- hpricot (~> 0.8.4)
- oa-oauth (~> 0.3.2)
- octokit (~> 0.6.5)
- omniauth
- postmark-rails (~> 0.4.1)
- pusher (~> 0.8.5)
- rabl (~> 0.5.1)
- rails (~> 3.1.2)
- rake (~> 0.9.2.2)
- simple_states (~> 0.1.0.pre2)
- thor (~> 0.14.6)
-
-GEM
- remote: http://rubygems.org/
- specs:
- actionmailer (3.1.3)
- actionpack (= 3.1.3)
- mail (~> 2.3.0)
- actionmailer_inline_css (1.4.0)
- actionmailer (>= 3.0.0)
- nokogiri (>= 1.4.4)
- premailer (>= 1.7.1)
- actionpack (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
- builder (~> 3.0.0)
- erubis (~> 2.7.0)
- i18n (~> 0.6)
- rack (~> 1.3.5)
- rack-cache (~> 1.1)
- rack-mount (~> 0.8.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.0.3)
- activemodel (3.1.3)
- activesupport (= 3.1.3)
- builder (~> 3.0.0)
- i18n (~> 0.6)
- activerecord (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
- arel (~> 2.2.1)
- tzinfo (~> 0.3.29)
- activerecord-jdbc-adapter (1.2.0)
- activerecord-jdbcpostgresql-adapter (1.2.0)
- activerecord-jdbc-adapter (~> 1.2.0)
- jdbc-postgres (~> 9.0.0)
- activeresource (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
- activesupport (3.1.3)
- multi_json (~> 1.0)
- addressable (2.2.6)
- amq-client (0.8.7)
- amq-protocol (>= 0.8.4)
- eventmachine
- amq-protocol (0.8.4)
- amqp (0.8.4)
- amq-client (~> 0.8.7)
- amq-protocol (~> 0.8.4)
- eventmachine
- arel (2.2.1)
- bcrypt-ruby (3.0.1)
- bcrypt-ruby (3.0.1-java)
- bouncy-castle-java (1.5.0146.1)
- builder (3.0.0)
- crack (0.3.1)
- css_parser (1.2.5)
- addressable
- data_migrations (0.0.1)
- activerecord
- rake
- database_cleaner (0.7.0)
- devise (1.5.2)
- bcrypt-ruby (~> 3.0)
- orm_adapter (~> 0.0.3)
- warden (~> 1.1)
- diff-lcs (1.1.3)
- erubis (2.7.0)
- eventmachine (0.12.10)
- factory_girl (2.3.2)
- activesupport
- faraday (0.7.5)
- addressable (~> 2.2.6)
- multipart-post (~> 1.1.3)
- rack (>= 1.1.0, < 2)
- faraday_middleware (0.7.0)
- faraday (~> 0.7.3)
- hashie (1.2.0)
- hashr (0.0.19)
- hike (1.2.1)
- hot_bunnies (1.3.3-java)
- hpricot (0.8.5)
- hpricot (0.8.5-java)
- htmlentities (4.3.1)
- i18n (0.6.0)
- jdbc-postgres (9.0.801)
- jruby-openssl (0.7.4)
- bouncy-castle-java
- json (1.6.3)
- json (1.6.3-java)
- mail (2.3.0)
- i18n (>= 0.4.0)
- mime-types (~> 1.16)
- treetop (~> 1.4.8)
- metaclass (0.0.1)
- mime-types (1.17.2)
- mocha (0.10.0)
- metaclass (~> 0.0.1)
- multi_json (1.0.4)
- multi_xml (0.4.1)
- multipart-post (1.1.4)
- nokogiri (1.5.0)
- nokogiri (1.5.0-java)
- oa-core (0.3.2)
- oa-oauth (0.3.2)
- faraday (~> 0.7.3)
- multi_json (~> 1.0.0)
- multi_xml (~> 0.4.0)
- oa-core (= 0.3.2)
- oauth (~> 0.4.0)
- oauth2 (~> 0.5.0)
- oauth (0.4.5)
- oauth2 (0.5.1)
- faraday (~> 0.7.4)
- multi_json (~> 1.0.3)
- octokit (0.6.5)
- addressable (~> 2.2.6)
- faraday (~> 0.7.4)
- faraday_middleware (~> 0.7.0)
- hashie (~> 1.2.0)
- multi_json (~> 1.0.2)
- omniauth (1.0.1)
- hashie (~> 1.2)
- rack
- orm_adapter (0.0.5)
- pg (0.11.0)
- polyglot (0.3.3)
- postmark (0.9.8)
- postmark-rails (0.4.1)
- actionmailer
- postmark (>= 0.9.0)
- rake
- premailer (1.7.3)
- css_parser (>= 1.1.9)
- htmlentities (>= 4.0.0)
- pusher (0.8.5)
- multi_json (~> 1.0)
- ruby-hmac (~> 0.4.0)
- signature (~> 0.1.2)
- rabl (0.5.1)
- activesupport (>= 2.3.14)
- multi_json (~> 1.0.3)
- rack (1.3.5)
- rack-cache (1.1)
- rack (>= 0.4)
- rack-mount (0.8.3)
- rack (>= 1.0.0)
- rack-ssl (1.3.2)
- rack
- rack-test (0.6.1)
- rack (>= 1.0)
- rails (3.1.3)
- actionmailer (= 3.1.3)
- actionpack (= 3.1.3)
- activerecord (= 3.1.3)
- activeresource (= 3.1.3)
- activesupport (= 3.1.3)
- bundler (~> 1.0)
- railties (= 3.1.3)
- railties (3.1.3)
- actionpack (= 3.1.3)
- activesupport (= 3.1.3)
- rack-ssl (~> 1.3.2)
- rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (~> 0.14.6)
- rake (0.9.2.2)
- rdoc (3.11)
- json (~> 1.4)
- rspec (2.7.0)
- rspec-core (~> 2.7.0)
- rspec-expectations (~> 2.7.0)
- rspec-mocks (~> 2.7.0)
- rspec-core (2.7.1)
- rspec-expectations (2.7.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.7.0)
- ruby-hmac (0.4.0)
- signature (0.1.2)
- ruby-hmac
- silent-postgres (0.1.1)
- simple_states (0.1.0.pre2)
- activesupport
- hashr (~> 0.0.10)
- sprockets (2.0.3)
- hike (~> 1.2)
- rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
- standalone_migrations (1.0.5)
- activerecord (>= 3)
- rake
- thor (0.14.6)
- tilt (1.3.3)
- treetop (1.4.10)
- polyglot
- polyglot (>= 0.3.1)
- tzinfo (0.3.31)
- warden (1.1.0)
- rack (>= 1.0)
- webmock (1.7.8)
- addressable (~> 2.2, > 2.2.5)
- crack (>= 0.1.7)
-
-PLATFORMS
- java
- ruby
-
-DEPENDENCIES
- activerecord-jdbc-adapter (= 1.2.0)
- activerecord-jdbcpostgresql-adapter (= 1.2.0)
- amqp (~> 0.8.3)
- database_cleaner (~> 0.7.0)
- factory_girl (~> 2.3.2)
- hot_bunnies (~> 1.3.3)
- jruby-openssl (~> 0.7.4)
- mocha (~> 0.10.0)
- pg (~> 0.11.0)
- rspec (~> 2.7.0)
- silent-postgres (~> 0.1.1)
- standalone_migrations (~> 1.0.5)
- travis-core!
- travis-support!
- webmock (~> 1.7.7)
View
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20111214173922) do
+ActiveRecord::Schema.define(:version => 20120114125404) do
create_table "artifacts", :force => true do |t|
t.text "content"
@@ -80,6 +80,7 @@
t.datetime "updated_at"
t.text "tags"
t.integer "retries", :default => 0
+ t.boolean "allow_failure", :default => false
end
add_index "jobs", ["queue", "state"], :name => "index_jobs_on_queue_and_state"
View
@@ -6,7 +6,7 @@ module Travis
class Config < Hashr
class << self
def env
- defined?(Rails) ? Rails.env : ENV['ENV'] || ENV['RAILS_ENV'] || 'development'
+ defined?(Rails) ? Rails.env : ENV['ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
end
def load_env
View
@@ -55,8 +55,17 @@ def paged(options)
limit(per_page).offset(per_page * (page - 1))
end
+ def older_than(build = nil)
+ criteria = if build
+ number = build.is_a?(Build) ? build.number : build
+ where('number::integer < ?', number.to_i)
+ else
+ Build
+ end
+ criteria.includes(:commit).order('number::int DESC').limit(per_page)
+ end
+
def next_number
- env = defined?(Rails) ? Rails.env : ENV['ENV'] || ENV['RAILS_ENV'] || 'test'
maximum(floor('number')).to_i + 1
end
@@ -38,7 +38,7 @@ def matrix_status(config = {})
tests = matrix_for(config)
if tests.blank?
nil
- elsif tests.all?(&:passed?)
+ elsif tests.all?(&:passed_or_allowed_to_fail?)
0
elsif tests.any?(&:failed?)
1
@@ -55,6 +55,15 @@ def expand_matrix
attributes.merge!(:number => "#{number}.#{ix + 1}", :config => config.merge(Hash[*row.flatten]), :log => Artifact::Log.new)
matrix.build(attributes)
end
+
+ matrix_allow_failures
+ end
+
+ def matrix_allow_failures
+ allow_configs = config_matrix_settings[:allow_failures] || []
+ allow_configs.each do |config|
+ matrix_for(config).each { |m| m.allow_failure = true }
+ end
end
def matrix_config
@@ -29,6 +29,10 @@ def passed?
status == 0
end
+ def passed_or_allowed_to_fail?
+ status == 0 || allow_failure
+ end
+
def failed?
status == 1
end
@@ -43,7 +43,7 @@ def search(query)
end
def find_by(params)
- if id = params[:id] || params[:repository_id]
+ if id = params[:repository_id] || params[:id]
self.find(id)
else
self.where(params.slice(:name, :owner_name)).first
@@ -78,4 +78,8 @@ def key
@key ||= old_key || SslKey.create(:repository_id => self.id)
end
+ def branches
+ builds.descending.paged({}).includes([:commit]).map{ |build| build.commit.branch }.uniq
+ end
+
end
@@ -26,7 +26,7 @@ def generate_keys
end
def generate_keys!
- public_key = private_key = nil
+ self.public_key = self.private_key = nil
generate_keys
end
Oops, something went wrong.

0 comments on commit 7187d59

Please sign in to comment.