33 lines
673 B
Elixir
33 lines
673 B
Elixir
|
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()
|
||
|
)
|
||
|
|
||
|
System.cmd("ssh", [host, "cd chronoscope && buildah build -t chronoscope:latest && podman auto-update"], into: IO.stream())
|
||
|
end
|
||
|
end
|