Format mix task info messages to improve readability
This commit is contained in:
@@ -11,7 +11,7 @@ defmodule Mix.Tasks.MusicLibrary.Prod.DbMigrate do
|
|||||||
|
|
||||||
@impl Mix.Task
|
@impl Mix.Task
|
||||||
def run(_args) do
|
def run(_args) do
|
||||||
Mix.Shell.IO.info("Running migrations on production database")
|
Mix.Shell.IO.info("==> Running migrations on production database")
|
||||||
|
|
||||||
fly_ssh("bin/migrate")
|
fly_ssh("bin/migrate")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ defmodule Mix.Tasks.MusicLibrary.Prod.DbPull do
|
|||||||
|
|
||||||
@impl Mix.Task
|
@impl Mix.Task
|
||||||
def run(_args) do
|
def run(_args) do
|
||||||
Mix.Shell.IO.info("Pulling the latest database from the production server")
|
Mix.Shell.IO.info("==> Pulling the latest database from the production server")
|
||||||
|
|
||||||
current_time = DateTime.utc_now()
|
current_time = DateTime.utc_now()
|
||||||
remote_db = "/mnt/music_library/music_library_prod.db"
|
remote_db = "/mnt/music_library/music_library_prod.db"
|
||||||
@@ -22,9 +22,9 @@ defmodule Mix.Tasks.MusicLibrary.Prod.DbPull do
|
|||||||
System.halt(1)
|
System.halt(1)
|
||||||
|
|
||||||
{_stream, 0} ->
|
{_stream, 0} ->
|
||||||
Mix.Shell.IO.info("Database pulled successfully")
|
Mix.Shell.IO.info("==> Database pulled successfully")
|
||||||
|
|
||||||
Mix.Shell.IO.info("Restoring as local dev database")
|
Mix.Shell.IO.info("==> Restoring as local dev database")
|
||||||
|
|
||||||
Path.wildcard("data/music_library_dev.db*")
|
Path.wildcard("data/music_library_dev.db*")
|
||||||
|> Enum.each(&File.rm!/1)
|
|> Enum.each(&File.rm!/1)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ defmodule Mix.Tasks.MusicLibrary.Prod.DbVacuum do
|
|||||||
|
|
||||||
@impl Mix.Task
|
@impl Mix.Task
|
||||||
def run(_args) do
|
def run(_args) do
|
||||||
Mix.Shell.IO.info("Running VACUUM on the production database")
|
Mix.Shell.IO.info("==> Running VACUUM on the production database")
|
||||||
|
|
||||||
command = ~s(bin/music_library rpc 'MusicLibrary.Repo.vacuum\(\)')
|
command = ~s(bin/music_library rpc 'MusicLibrary.Repo.vacuum\(\)')
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ defmodule Mix.Tasks.MusicLibrary.Prod.Ping do
|
|||||||
@impl Mix.Task
|
@impl Mix.Task
|
||||||
def run(_args) do
|
def run(_args) do
|
||||||
Application.ensure_all_started(:req)
|
Application.ensure_all_started(:req)
|
||||||
Mix.Shell.IO.info("Pinging the production instance")
|
Mix.Shell.IO.info("==> Pinging the production instance")
|
||||||
|
|
||||||
Req.get!("https://music-library.claudio-ortolina.org/api")
|
Req.get!("https://music-library.claudio-ortolina.org/api")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user