Skip to content

Commit

Permalink
Hotfix: Separate fly.rake into it's own file
Browse files Browse the repository at this point in the history
  • Loading branch information
krschacht committed Jul 13, 2024
1 parent 9747807 commit 324fd4e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
15 changes: 15 additions & 0 deletions lib/tasks/db/fly.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace :db do
desc "Change fly VM"
task :fly, [:app_name, :command, :detail] => :environment do |t, args|
if args[:app_name].nil? || args[:command].nil? || args[:detail].nil?
puts "Missing arguments. Call with bin/rails fly[APP_NAME,COMMAND,DETAIL]"
return
end

if args[:command] == "swap"
Fly.new.change_db_swap(app: args[:app_name], swap: args[:detail].to_i)
else
puts "Unrecognized command #{args[:command]}"
end
end
end
14 changes: 0 additions & 14 deletions lib/tasks/prepare.rake → lib/tasks/db/prepare.rake
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
namespace :db do
desc "Change fly VM"
task :fly, [:app_name, :command, :detail] => :environment do |t, args|
if args[:app_name].nil? || args[:command].nil? || args[:detail].nil?
puts "Missing arguments. Call with bin/rails fly[APP_NAME,COMMAND,DETAIL]"
return
end

if args[:command] == "swap"
Fly.new.change_db_swap(app: args[:app_name], swap: args[:detail].to_i)
else
puts "Unrecognized command #{args[:command]}"
end
end

desc "Setup database encryption and update credentials"
task :setup_encryption, [:send_to_fly] => :environment do |t, args|
args.with_defaults(send_to_fly: false)
Expand Down

0 comments on commit 324fd4e

Please sign in to comment.