Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 796 Bytes

2016-07-18-mix-elixir-release.md

File metadata and controls

36 lines (22 loc) · 796 Bytes

thanks 元气糯米团子的Coding Blog

Elixir发布管理器(Elixir Release Manager)是一个Elixir任务模块,用于把一个完整Elixir项目打包为一个.tar.gz文件用于发布和部署.

首先, 需要在mix.exs文件中添加如下依赖:

defp deps do
    [{:exrm, "~> 0.14.16"}]
end

exrm的版本需要在hex上查最新版本号。

下载依赖,并编译

mix deps.get
mix deps.compile

发布项目

mix release

....
==> The release for ecto_test-0.0.1 is ready!
==> You can boot a console running your release with `$ rel/ecto_test/bin/ecto_test console`

之后就生成在build下可以直接启动了。