-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tasks to print out ENV variables and start the replication process
- Loading branch information
1 parent
ad780f9
commit edb277a
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |