diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-08-11 17:10:28 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-08-11 17:10:28 +0200 |
commit | 0b0a53ee5ec3782c6c7e166f69f190e820232fb0 (patch) | |
tree | b2cd0518594a933ec2c68c2f883026bb82da3569 /app/models/ci/build.rb | |
parent | 0b52517049fc8ac01407018c8a6225d7788861a3 (diff) | |
parent | 4c29c25497c9a20a5d1f57cd287123cd41edad96 (diff) | |
download | gitlab-ce-0b0a53ee5ec3782c6c7e166f69f190e820232fb0.tar.gz |
Merge remote-tracking branch 'origin/master' into pipeline-hooks-without-slack
# Conflicts:
# app/models/ci/pipeline.rb
# app/services/ci/create_pipeline_service.rb
# spec/models/project_services/hipchat_service_spec.rb
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r-- | app/models/ci/build.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index b919846af22..05b11f3b115 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -16,7 +16,7 @@ module Ci scope :with_artifacts_not_expired, ->() { with_artifacts.where('artifacts_expire_at IS NULL OR artifacts_expire_at > ?', Time.now) } scope :with_expired_artifacts, ->() { with_artifacts.where('artifacts_expire_at < ?', Time.now) } scope :last_month, ->() { where('created_at > ?', Date.today - 1.month) } - scope :manual_actions, ->() { where(when: :manual) } + scope :manual_actions, ->() { where(when: :manual).relevant } mount_uploader :artifacts_file, ArtifactUploader mount_uploader :artifacts_metadata, ArtifactUploader @@ -65,17 +65,11 @@ module Ci end end - state_machine :status, initial: :pending do + state_machine :status do after_transition pending: :running do |build| build.execute_hooks end - # We use around_transition to create builds for next stage as soon as possible, before the `after_*` is executed - around_transition any => [:success, :failed, :canceled] do |build, block| - block.call - build.pipeline.create_next_builds(build) if build.pipeline - end - after_transition any => [:success, :failed, :canceled] do |build| build.update_coverage build.execute_hooks |