thanks for your answers.
I replaced all occurences of the app name with MyApp so I hope I did not miss anything.
the command to build the release is the following:
MIX_ENV=prod mix compile
and MIX_ENV=prod mix release
trying to execute the following command: rel/my_app/bin/my_app command sync_release seed
here is my mix file:
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[app: :my_app,
version: "0.0.24",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps]
end
# Configuration for the OTP application
#
# Type `mix help compile.app` for more information
def application do
[mod: {MyApp, []},
applications: [:phoenix, :phoenix_html, :cowboy, :logger,
:phoenix_ecto, :postgrex, :remodel, :mailgun,
:geo, :ex_csv, :scrivener, :cors_plug,
:timex, :uuid, :ssl, :erlcloud, :csv,
:honeybadger]]
end
# Specifies which paths to compile per environment
defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
defp elixirc_paths(_), do: ["lib", "web"]
# Specifies your project dependencies
#
# Type `mix help deps` for examples and options
defp deps do
[{:phoenix, "~> 1.1"},
{:phoenix_ecto, ">= 1.0.0"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.1"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:cowboy, "~> 1.0"},
{:mailgun, "~> 0.1.2"},
{:remodel, "~> 0.0.1"},
{:ex_csv, "~> 0.1.3"},
{:csv, "~> 1.1.5"},
{:geo, "~> 1.0"},
{:exq, "~> 0.4"},
{:scrivener, "~> 1.1"},
{:cors_plug, "~> 0.1.4"},
{:erlcloud, "~> 0.12.0"},
{:honeybadger, "~> 0.3"},
{:exrm_docker, "~> 0.1"},
{:exrm, "~> 1.0.4"}]
end
end
and my release_tasks module
defmodule :sync_release do
def seed do
repo = MyApp.Repo
start_repo(repo)
info "Seeding data for #{inspect repo}.."
#seed
:init.stop()
end
def migrate do
repo = MyApp.Repo
start_repo(repo)
path = Application.app_dir(:my_app, "priv/repo/migrations")
Ecto.Migrator.run(MyApp.Repo, path, :up, all: true)
:init.stop()
end
defp start_applications(apps) do
Enum.each(apps, fn app ->
{_ , message } = Application.ensure_all_started(app)
info "Start application #{inspect app} got message: #{inspect message}"
end)
end
defp start_repo(repo) do
load_app()
info "Start Repo"
message = repo.start_link()
info(inspect message)
end
defp load_app do
start_applications([:logger, :postgrex, :ecto])
info "Loading App"
:ok = Application.load(:my_app)
end
defp info(message) do
IO.puts(message)
end
defp fatal(message) do
IO.puts :stderr, message
System.halt(1)
end
end
@defoemark are you sure I need the compiler
inside the rel/my_app/lib/ folder
?