add touchless docker deploys

This commit is contained in:
2021-09-04 16:14:51 -04:00
committed by oliviasculley
parent eefde769dd
commit 6675c1dfab
12 changed files with 142 additions and 6953 deletions

20
lib/cannery/release.ex Normal file
View File

@ -0,0 +1,20 @@
defmodule Cannery.Release do
@app :cannery
def rollback(repo, version) do
load_app()
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
end
defp load_app do
Application.load(@app)
end
def migrate do
load_app()
for repo <- Application.fetch_env!(@app, :ecto_repos) do
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true))
end
end
end