summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-10 22:33:39 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-10 22:33:39 -0800
commit7a0937fc5952cc6849fc14829d5686e8b8bf9dd0 (patch)
tree3f50681201f7c5582170fec4bb5c15834aa8f11f /app/models/commit.rb
parent627281639ae2749dbd4aad4d7c9930591399ef2a (diff)
downloadgitlab-ci-7a0937fc5952cc6849fc14829d5686e8b8bf9dd0.tar.gz
Job can serve branches or tags or both
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 0e10033..13630bc 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -97,7 +97,16 @@ class Commit < ActiveRecord::Base
end
def create_builds
- project.jobs.active.map do |job|
+ project.jobs.where(build_branches: true).active.map do |job|
+ build = builds.new(commands: job.commands)
+ build.job = job
+ build.save
+ build
+ end
+ end
+
+ def create_builds_for_tag
+ project.jobs.where(build_tags: true).active.map do |job|
build = builds.new(commands: job.commands)
build.job = job
build.save