Skip to content

Commit ee11711

Browse files
committed
feat(nodejs:website): Add blog mix release.
1 parent bcd90f4 commit ee11711

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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最强大的特性,热更新**

nodejs/packages/website/src/blogList.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,4 +424,12 @@ blogs.push({
424424
author: 'Gao',
425425
});
426426

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+
427435
export default blogs.slice().reverse();

0 commit comments

Comments
 (0)