Skip to content

Commit

Permalink
Add tasks to print out ENV variables and start the replication process
Browse files Browse the repository at this point in the history
  • Loading branch information
fractaledmind committed Dec 11, 2023
1 parent ad780f9 commit edb277a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/tasks/litestream_tasks.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace :litestream do
desc "Print the ENV variables needed for the Litestream config file"
task env: :environment do
if Litestream.configuration.nil?
warn "You have not configured the Litestream gem with any values to generate ENV variables"
next
end

puts "LITESTREAM_DATABASE_PATH=#{Litestream.configuration.database_path}"
puts "LITESTREAM_REPLICA_URL=#{Litestream.configuration.replica_url}"
puts "LITESTREAM_REPLICA_KEY_ID=#{Litestream.configuration.replica_key_id}"
puts "LITESTREAM_REPLICA_ACCESS_KEY=#{Litestream.configuration.replica_access_key}"

true
end

desc ""
task replicate: :environment do
Litestream::Commands.replicate
end
end

0 comments on commit edb277a

Please sign in to comment.