chronoscope/lib/mix/tasks/deploy.ex

37 lines
722 B
Elixir
Raw Permalink Normal View History

2024-03-27 09:11:42 -04:00
defmodule Mix.Tasks.Deploy do
use Mix.Task
@moduledoc """
Deploy this application to production.
"""
@shortdoc "deploy to production"
@spec run([...]) :: any
def run([host]) do
System.cmd(
"rsync",
[
"--archive",
"--delete",
"--compress",
"--human-readable",
"--progress",
"--stats",
"--verbose",
"--exclude-from=.gitignore",
"--exclude=.git/",
"./",
"#{host}:chronoscope/"
],
into: IO.stream()
)
2024-04-03 11:40:36 -04:00
System.cmd(
"ssh",
[host, "cd chronoscope && buildah build -t chronoscope:latest && podman auto-update && podman image prune -f"],
into: IO.stream()
)
2024-03-27 09:11:42 -04:00
end
end