diff options
author | Eirik Lygre <eirik.lygre@gmail.com> | 2015-12-09 15:07:10 +0100 |
---|---|---|
committer | Eirik Lygre <eirik.lygre@gmail.com> | 2015-12-09 15:07:10 +0100 |
commit | bb79573c01ad77d6b52245d3af262bc56f79693f (patch) | |
tree | 1bd51c1c8adc50462f22591d6ab5af8315cf9eb6 /app/models/commit_status.rb | |
parent | 94dc9ef9e1a85b8a4506358479a549dc3a1306b6 (diff) | |
parent | 9bfd6c44e23754b6f699586f6a0cec2879e107e0 (diff) | |
download | gitlab-ce-bb79573c01ad77d6b52245d3af262bc56f79693f.tar.gz |
Merge branch 'master' into default_clone_protocol_based_on_user_keys
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index e70f4d37184..ff619965a57 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -1,34 +1,30 @@ # == Schema Information # -# Table name: ci_builds -# -# id :integer not null, primary key -# project_id :integer -# status :string(255) -# finished_at :datetime -# trace :text -# created_at :datetime -# updated_at :datetime -# started_at :datetime -# runner_id :integer -# coverage :float -# commit_id :integer -# commands :text -# job_id :integer -# name :string(255) -# deploy :boolean default(FALSE) -# options :text -# allow_failure :boolean default(FALSE), not null -# stage :string(255) -# trigger_request_id :integer -# stage_idx :integer -# tag :boolean -# ref :string(255) -# user_id :integer -# type :string(255) -# target_url :string(255) -# description :string(255) -# artifacts_file :text +# project_id integer +# status string +# finished_at datetime +# trace text +# created_at datetime +# updated_at datetime +# started_at datetime +# runner_id integer +# coverage float +# commit_id integer +# commands text +# job_id integer +# name string +# deploy boolean default: false +# options text +# allow_failure boolean default: false, null: false +# stage string +# trigger_request_id integer +# stage_idx integer +# tag boolean +# ref string +# user_id integer +# type string +# target_url string +# description string # class CommitStatus < ActiveRecord::Base @@ -79,6 +75,10 @@ class CommitStatus < ActiveRecord::Base build.update_attributes finished_at: Time.now end + after_transition [:pending, :running] => :success do |build, transition| + MergeRequests::MergeWhenBuildSucceedsService.new(build.commit.gl_project, nil).trigger(build) + end + state :pending, value: 'pending' state :running, value: 'running' state :failed, value: 'failed' |