Add Staging specific seed file (#19434)

This commit is contained in:
Mac Siri 2023-05-10 16:10:19 -04:00 committed by GitHub
parent 4c28a607ec
commit b4a4b30153
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

View file

@ -14,6 +14,7 @@ ignore:
- "**/*.svg"
- "lib/sitemap_generator"
- "lib/generators"
- "lib/tasks/custom_seeds.rake"
coverage:
status:
patch:

2
db/seeds_staging.rb Normal file
View file

@ -0,0 +1,2 @@
filename = Rails.root.join("db/seeds.rb")
load(filename)

View file

@ -8,7 +8,7 @@ namespace :db do
raise "Attempting to seed production environment, aborting!" if Rails.env.production?
filename = SEED_DIR.join("seeds_e2e.rb")
load(filename) if File.exist?(filename)
load(filename)
end
desc "Creator Onboarding seed data for e2e tests"
@ -16,7 +16,14 @@ namespace :db do
raise "Attempting to seed production environment, aborting!" if Rails.env.production?
filename = SEED_DIR.join("creator_onboarding_seed_e2e.rb")
load(filename) if File.exist?(filename)
load(filename)
end
desc "Preview environment seed data for Uffizzi"
task staging: :environment do
raise "Attempting to seed production environment, aborting!" if Rails.env.production?
load(Rails.root.join("db/seeds_staging.rb"))
end
end
end

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
bundle exec rake db:seed
SEEDS_MULTIPLIER=2 bundle exec rake db:seed:staging
tail -f /dev/null
tail -f /dev/null