diff options
author | James Lopez <james@gitlab.com> | 2019-07-16 08:49:30 +0000 |
---|---|---|
committer | James Lopez <james@gitlab.com> | 2019-07-16 08:49:30 +0000 |
commit | 7b98d0bc54f0fb044511809ccbc9e80b347e1699 (patch) | |
tree | 0cc9162d6756d8b1795905f16a24af1fb932db4c /lib | |
parent | 00b944afb88d1e52add0724c7d5cc6b62505ec32 (diff) | |
parent | 0175a7ab15856a5383b94033341405b3b631c51b (diff) | |
download | gitlab-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.rake | 7 |
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 |