summaryrefslogtreecommitdiff
path: root/app/models/ci/build.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-08-11 17:10:28 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-08-11 17:10:28 +0200
commit0b0a53ee5ec3782c6c7e166f69f190e820232fb0 (patch)
treeb2cd0518594a933ec2c68c2f883026bb82da3569 /app/models/ci/build.rb
parent0b52517049fc8ac01407018c8a6225d7788861a3 (diff)
parent4c29c25497c9a20a5d1f57cd287123cd41edad96 (diff)
downloadgitlab-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.rb10
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