neiam
/apollos_crib
It's Apollo's Crib
public · Issues · Pulls 1 · Labels · Forks · Compare · Actions failure · Badges · Packages
⭐
Log in to mark this repository.
some other
c9dae76 · gmorell · 2022-08-05 22:02
Files changed
modified
apps/room_hermes/config/runtime.exs
+1
−1
@@ -43,7 +43,7 @@ if config_env() == :prod do
| 43 | 43 | """ |
| 44 | 44 | |
| 45 | 45 | host = System.get_env("PHX_HOST") || "example.com" |
| 46 | − port = String.to_integer(System.get_env("PORT") || "4000") | |
| 46 | + port = String.to_integer(System.get_env("PORT") || "4001") | |
| 47 | 47 | |
| 48 | 48 | config :room_sanctum, |
| 49 | 49 | RoomHermesWeb.Endpoint, |
added
apps/room_hermes/lib/release.ex
+28
−0
@@ -0,0 +1,28 @@
| 1 | +defmodule RoomHermes.Release do | |
| 2 | + @moduledoc """ | |
| 3 | + Used for executing DB release tasks when run in production without Mix | |
| 4 | + installed. | |
| 5 | + """ | |
| 6 | + @app :room_hermes | |
| 7 | + | |
| 8 | + def migrate do | |
| 9 | + load_app() | |
| 10 | + | |
| 11 | + for repo <- repos() do | |
| 12 | + {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true)) | |
| 13 | + end | |
| 14 | + end | |
| 15 | + | |
| 16 | + def rollback(repo, version) do | |
| 17 | + load_app() | |
| 18 | + {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version)) | |
| 19 | + end | |
| 20 | + | |
| 21 | + defp repos do | |
| 22 | + Application.fetch_env!(@app, :ecto_repos) | |
| 23 | + end | |
| 24 | + | |
| 25 | + defp load_app do | |
| 26 | + Application.load(@app) | |
| 27 | + end | |
| 28 | +end |
modified
config/runtime.exs
+1
−1
@@ -92,7 +92,7 @@ if config_env() == :prod do
| 92 | 92 | """ |
| 93 | 93 | |
| 94 | 94 | host = System.get_env("PHX_HOST") || "example.com" |
| 95 | − port = String.to_integer(System.get_env("SPORT") || "4000") | |
| 95 | + port = String.to_integer(System.get_env("SPORT") || "4001") | |
| 96 | 96 | |
| 97 | 97 | config :room_sanctum, RoomSanctumWeb.Endpoint, |
| 98 | 98 | url: [host: host, port: 443], |
Parents: 804a266