summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Lopez <james@gitlab.com>2019-07-16 08:49:30 +0000
committerJames Lopez <james@gitlab.com>2019-07-16 08:49:30 +0000
commit7b98d0bc54f0fb044511809ccbc9e80b347e1699 (patch)
tree0cc9162d6756d8b1795905f16a24af1fb932db4c /lib
parent00b944afb88d1e52add0724c7d5cc6b62505ec32 (diff)
parent0175a7ab15856a5383b94033341405b3b631c51b (diff)
downloadgitlab-ce-7b98d0bc54f0fb044511809ccbc9e80b347e1699.tar.gz
Merge branch 'bw-enhance-rake-seed' into 'master'
Allow parameters for rake gitlab:seed:issues See merge request gitlab-org/gitlab-ce!30689
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/gitlab/seed.rake7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/seed.rake b/lib/tasks/gitlab/seed.rake
index 155ba979b36..d76e38b73b5 100644
--- a/lib/tasks/gitlab/seed.rake
+++ b/lib/tasks/gitlab/seed.rake
@@ -1,7 +1,9 @@
namespace :gitlab do
namespace :seed do
desc "GitLab | Seed | Seeds issues"
- task :issues, [:project_full_path] => :environment do |t, args|
+ task :issues, [:project_full_path, :backfill_weeks, :average_issues_per_week] => :environment do |t, args|
+ args.with_defaults(backfill_weeks: 5, average_issues_per_week: 2)
+
projects =
if args.project_full_path
project = Project.find_by_full_path(args.project_full_path)
@@ -26,7 +28,8 @@ namespace :gitlab do
projects.each do |project|
puts "\nSeeding issues for the '#{project.full_path}' project"
seeder = Quality::Seeders::Issues.new(project: project)
- issues_created = seeder.seed(backfill_weeks: 5, average_issues_per_week: 2)
+ issues_created = seeder.seed(backfill_weeks: args.backfill_weeks.to_i,
+ average_issues_per_week: args.average_issues_per_week.to_i)
puts "\n#{issues_created} issues created!"
end
end