File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ # 使用Mix.release代替distillery
2
+
3
+ Elixir在1.9中推出了mix.release功能,来发布OTP版本
4
+
5
+ 由于是语言本身提供的功能,在phoenix中提供了runtime config配置来处理对应参数,相对于distillery开发方便了很多。
6
+
7
+ 简单实用方法:
8
+
9
+ 初始化release
10
+ ``` bash
11
+ mix release.init
12
+ ```
13
+
14
+ 会生成并创建
15
+ ```
16
+ rel/
17
+ env.bat.eex
18
+ env.sh.eex
19
+ remote.vm.args.eex
20
+ vm.args.eex
21
+ ```
22
+
23
+ 在` mix.exs ` 中添加
24
+ ``` elixir
25
+ def project do
26
+ [
27
+ # ...
28
+ releases: [
29
+ gsmlg_umbrella: [
30
+ applications: [
31
+ gsmlg: :permanent ,
32
+ gsmlg_web: :permanent
33
+ ]
34
+ ],
35
+ gsmlg_web_only: [
36
+ applications: [gsmlg_web: :permanent ]
37
+ ],
38
+ gsmlg_only: [
39
+ applications: [gsmlg: :permanent ]
40
+ ]
41
+ ]
42
+ # ...
43
+ ]
44
+ end
45
+ ```
46
+
47
+ 发布版本
48
+ ``` bash
49
+ MIX_ENV=prod mix release << release name>>
50
+ ` ` `
51
+
52
+ # ## 相对与`distillery`的不同
53
+
54
+ 相对于` distillery` 配置来说大大的简化了对应的配置
55
+
56
+ 缺点是: ** 不再支持erlang VM最强大的特性,热更新**
Original file line number Diff line number Diff line change @@ -424,4 +424,12 @@ blogs.push({
424
424
author : 'Gao' ,
425
425
} ) ;
426
426
427
+ blogs . push ( {
428
+ id : 54 ,
429
+ name : 'mix-release' ,
430
+ title : '使用Mix.release代替distillery' ,
431
+ date : '2021-10-14' ,
432
+ author : 'Gao' ,
433
+ } ) ;
434
+
427
435
export default blogs . slice ( ) . reverse ( ) ;
You can’t perform that action at this time.
0 commit comments