diff options
-rw-r--r-- | app/models/build.rb | 2 | ||||
-rw-r--r-- | app/models/commit.rb | 2 | ||||
-rw-r--r-- | spec/models/commit_spec.rb | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/app/models/build.rb b/app/models/build.rb index ce634c8..2cdee83 100644 --- a/app/models/build.rb +++ b/app/models/build.rb @@ -117,7 +117,7 @@ class Build < ActiveRecord::Base WebHookService.new.build_end(build) end - build.commit.run_deploy_job(build.ref) + build.commit.create_deploy_builds(build.ref) project.execute_services(build) if project.coverage_enabled? diff --git a/app/models/commit.rb b/app/models/commit.rb index e92af46..11b61d4 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -132,7 +132,7 @@ class Commit < ActiveRecord::Base @retried_builds ||= (builds - builds_without_retry) end - def run_deploy_job(ref) + def create_deploy_builds(ref) if success? && !last_build.job.deploy? project.jobs.deploy.active.each do |job| if job.run_for_ref?(ref) diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index f457d09..891cd52 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -160,7 +160,7 @@ describe Commit do it { should eq(project.gitlab?) } end - describe "run_deploy_job" do + describe "create_deploy_builds" do before do job = FactoryGirl.create :job, project: project job1 = FactoryGirl.create :job, project: project @@ -171,7 +171,7 @@ describe Commit do end it "creates new build for deploy" do - commit.run_deploy_job(commit.ref) + commit.create_deploy_builds(commit.ref) commit.builds.size.should == 3 end |