diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-04-01 15:23:01 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-04-01 15:23:01 +0300 |
commit | edfe6539b4c39caaffce119b8d716e94c86c9169 (patch) | |
tree | bb62b6078d993efda8ee615f2c692fe89e1910ff /app/models | |
parent | 2378f2c8cb0cdd9538c0336a359deadf52255adc (diff) | |
download | gitlab-ci-deploy_without_tests.tar.gz |
refactoring of deploy job creationdeploy_without_tests
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/build.rb | 5 | ||||
-rw-r--r-- | app/models/commit.rb | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/app/models/build.rb b/app/models/build.rb index 0cecc19..fa0cb8f 100644 --- a/app/models/build.rb +++ b/app/models/build.rb @@ -118,7 +118,10 @@ class Build < ActiveRecord::Base WebHookService.new.build_end(build) end - build.commit.create_deploy_builds(build.ref) + if build.commit.success? && !build.job.deploy? + build.commit.create_deploy_builds(build.ref) + end + project.execute_services(build) if project.coverage_enabled? diff --git a/app/models/commit.rb b/app/models/commit.rb index 32bd334..5f1aa92 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -137,11 +137,9 @@ class Commit < ActiveRecord::Base end def create_deploy_builds(ref) - if builds.empty? || (success? && !last_build.job.deploy?) - project.jobs.deploy.active.each do |job| - if job.run_for_ref?(ref) - create_build_from_job(job) - end + project.jobs.deploy.active.each do |job| + if job.run_for_ref?(ref) + create_build_from_job(job) end end end |