diff options
author | Brett Walker <bwalker@gitlab.com> | 2019-07-12 15:02:45 -0500 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2019-07-15 11:33:39 -0500 |
commit | 0175a7ab15856a5383b94033341405b3b631c51b (patch) | |
tree | 4645e1450a23fe564427ebd780914e548e3e9e4e | |
parent | 222d0019e4c23bbc43114f893891611acf028651 (diff) | |
download | gitlab-ce-0175a7ab15856a5383b94033341405b3b631c51b.tar.gz |
Allow parameters for rake gitlab:seed:issuesbw-enhance-rake-seed
to specify backfill_weeks and average_issues_per_week
-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 |