diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-10 22:33:39 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-10 22:33:39 -0800 |
commit | 7a0937fc5952cc6849fc14829d5686e8b8bf9dd0 (patch) | |
tree | 3f50681201f7c5582170fec4bb5c15834aa8f11f /app/models/commit.rb | |
parent | 627281639ae2749dbd4aad4d7c9930591399ef2a (diff) | |
download | gitlab-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.rb | 11 |
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 |