Make houdini_upgrade:run check for required tasks and add description
This commit is contained in:
parent
936ea739a7
commit
69c2802a5d
1 changed files with 37 additions and 12 deletions
|
@ -28,18 +28,43 @@ end
|
||||||
|
|
||||||
namespace :houdini_upgrade do
|
namespace :houdini_upgrade do
|
||||||
Rake::Task["install:migrations"].clear_comments
|
Rake::Task["install:migrations"].clear_comments
|
||||||
desc "Run houdini upgrade to v2"
|
desc <<-RUBY
|
||||||
task :run, [:aws_bucket, :aws_region, :aws_assethost] do |t, args|
|
Run houdini upgrade to v2
|
||||||
Rake::Task["houdini_upgrade:install:migrations"].invoke
|
DESC:
|
||||||
Rake::Task["active_storage:install"].invoke
|
This task automates some of the process of upgrading to Houdini v2. It does
|
||||||
Rake::Task["houdini_upgrade:cw_to_activestorage"].invoke(*args)
|
the following:
|
||||||
sh 'bundle'
|
* installs and runs database migrations
|
||||||
Rake::Task["db:migrate"].invoke
|
* migrates images from Carrierwave on AWS to your default ActiveStorage service
|
||||||
sh "rails houdini_upgrade:migrate_uploads"
|
|
||||||
Rake::Task["houdini_upgrade:create_backup_uploader_migration"].invoke
|
USAGE: bin/rails houdini_upgrade:run[aws_bucket,aws_region]
|
||||||
sh "rails db:migrate"
|
|
||||||
Rake::Task["houdini_upgrade:cleanup_upgrade_files"].invoke
|
TASK ARGUMENTS:
|
||||||
sh 'bundle'
|
aws_bucket (required): the name of your AWS bucket where all your carrierwave images are hosted
|
||||||
|
aws_region (required): AWS region of your AWS bucket. Carrierwave won\'t work
|
||||||
|
without it.
|
||||||
|
aws_assethost: protocol and domain where your AWS bucket contents can be
|
||||||
|
accessed. For example, this could be through Cloudfront
|
||||||
|
shorter_test: a testing only argument which cuts down the number of images we copy
|
||||||
|
RUBY
|
||||||
|
task :run, [:aws_bucket, :aws_region, :aws_assethost, :shorter_test] do |t, args|
|
||||||
|
if args[:aws_bucket].blank? || args[:aws_region].blank?
|
||||||
|
puts "You must set aws_bucket and aws_region for houdini_upgrade:run like:"
|
||||||
|
puts " houdini_upgrade:run[aws_bucket,aws_region]"
|
||||||
|
puts ""
|
||||||
|
puts "See the full task description by running `bin/rails -D` or "
|
||||||
|
puts "visit `docs/houdini_upgrade.md`"
|
||||||
|
else
|
||||||
|
Rake::Task["houdini_upgrade:install:migrations"].invoke
|
||||||
|
Rake::Task["active_storage:install"].invoke
|
||||||
|
Rake::Task["houdini_upgrade:cw_to_activestorage"].invoke(*args)
|
||||||
|
sh 'bundle'
|
||||||
|
Rake::Task["db:migrate"].invoke
|
||||||
|
sh "rails houdini_upgrade:migrate_uploads"
|
||||||
|
Rake::Task["houdini_upgrade:create_backup_uploader_migration"].invoke
|
||||||
|
sh "rails db:migrate"
|
||||||
|
Rake::Task["houdini_upgrade:cleanup_upgrade_files"].invoke
|
||||||
|
sh 'bundle'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
task :cw_to_activestorage, [:aws_bucket, :aws_region, :aws_assethost] do |t, args|
|
task :cw_to_activestorage, [:aws_bucket, :aws_region, :aws_assethost] do |t, args|
|
||||||
|
|
Loading…
Reference in a new issue