Extract fly helpers for Mix tasks

This commit is contained in:
Claudio Ortolina
2024-12-01 12:27:07 +00:00
parent bdfae15f35
commit c4cafa0bf6
4 changed files with 17 additions and 3 deletions
@@ -7,10 +7,12 @@ defmodule Mix.Tasks.MusicLibrary.Prod.DbMigrate do
Requires the `flyctl` CLI to be installed and authenticated.
"""
import Mix.Tasks.MusicLibrary.Prod.Helpers
@impl Mix.Task
def run(_args) do
IO.puts("Running migrations on production database")
System.cmd("flyctl", ["ssh", "console", "--command", "bin/migrate"], into: IO.stream())
fly_ssh("bin/migrate")
end
end