diff options
author | Valery Sizov <valery@gitlab.com> | 2015-03-10 12:33:20 +0000 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-03-10 12:33:20 +0000 |
commit | c95dfd87376bfe3913def89a34b47ad629e96073 (patch) | |
tree | 462753fd59671671b1617853a70252fa0e8f2581 | |
parent | 96e81bddd513b1d4d9e558e13fcf4c5d5f6b141e (diff) | |
parent | 7a6b39c9a919e05d2566bcb3b8b6a4f9b454c71e (diff) | |
download | gitlab-ci-c95dfd87376bfe3913def89a34b47ad629e96073.tar.gz |
Merge branch 'deploy_build_refactoring' into 'master'
Rename method run_deploy_job to create_deploy_builds
See merge request !134
-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 |