summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-06-18 15:32:45 +0300
committerValery Sizov <vsv2711@gmail.com>2015-06-18 15:32:45 +0300
commitfac76e77fc7fed5cb96cc58b9894c82ef63e1164 (patch)
treec4c6627715367e86d9caae0103c3248b245b236f
parent6a0528281bfa643a1059814586640f9a48cd4747 (diff)
downloadgitlab-ci-fac76e77fc7fed5cb96cc58b9894c82ef63e1164.tar.gz
skip_refs to each jobs
-rw-r--r--db/migrate/20150601043227_migrate_jobs_to_yaml.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/db/migrate/20150601043227_migrate_jobs_to_yaml.rb b/db/migrate/20150601043227_migrate_jobs_to_yaml.rb
index e7cdf2b..56570e2 100644
--- a/db/migrate/20150601043227_migrate_jobs_to_yaml.rb
+++ b/db/migrate/20150601043227_migrate_jobs_to_yaml.rb
@@ -22,6 +22,14 @@ class MigrateJobsToYaml < ActiveRecord::Migration
AND job_type = 'parallel'
GROUP BY j.id"
+ # skip_refs migrate
+ skip_refs = []
+
+ if project["skip_refs"].present?
+ skip_refs = project["skip_refs"].split(",").map(&:strip).select{|ref| ref =~ /^[\w-]*\Z/ }
+ end
+
+
# Create Jobs
select_all(sql).each do |job|
config[job["name"].to_s] = {
@@ -30,8 +38,9 @@ class MigrateJobsToYaml < ActiveRecord::Migration
}
except = build_except_param(parse_boolean_value(job["build_branches"]), parse_boolean_value(job["build_tags"]))
+ except = except + skip_refs
- if except
+ if except.any?
config[job["name"].to_s][:except] = except
end
end
@@ -45,8 +54,9 @@ class MigrateJobsToYaml < ActiveRecord::Migration
}
except = build_except_param(parse_boolean_value(job["build_branches"]), parse_boolean_value(job["build_tags"]))
+ except = except + skip_refs
- if except
+ if except.any?
config[job["name"].to_s][:except] = except
end
end
@@ -78,6 +88,6 @@ class MigrateJobsToYaml < ActiveRecord::Migration
return ["tags"]
end
- false
+ []
end
end