Erlang Build Tools--系列6

 转载:https://bitbucket.org/basho/rebar/wiki/ReleaseHandling

 

Release Handling

Introducing reltool.config

Rebar produces the reltool.config configuration file in response to performing the create-node command. The reltool.config contains configuration information consumed by rebar, and Reltool (the release management tool introduced in the Erlang R13B distribution).

Create the application:

1

$
 ./rebar create-app appid
=
exemplar

Notice: The commands 'create-app' and 'create-node' can be seen in rebar_templater.erl . Also, the variables that may be supplied to these commands can be seen in the respective templates, simpleapp.template and simplenode.template .

And to create the node:

Manually create the rel directory:

1

2
$
 mkdir rel
$ cd rel

create the node:

 1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$
 ../rebar create-node nodeid
=
exemplar

$ ls -lR
total 8
drwxr-xr-x 5 iw iw 170 13 Jan 13:33 overlay
-rw-r--r-- 1 iw iw 612 13 Jan 13:33 reltool.config

./overlay:
total 0
drwxr-xr-x 3 iw iw 102 13 Jan 13:33 bin
drwxr-xr-x 3 iw iw 102 13 Jan 13:33 erts-vsn
drwxr-xr-x 4 iw iw 136 13 Jan 13:33 etc

./overlay/bin:
total 8
-rw-r--r-- 1 iw iw 3368 13 Jan 13:33 exemplar

./overlay/erts-vsn:
total 0
drwxr-xr-x 4 iw iw 136 13 Jan 13:33 bin

./overlay/erts-vsn/bin:
total 16
-rw-r--r-- 1 iw iw 1118 13 Jan 13:33 erl
-rw-r--r-- 1 iw iw 2940 13 Jan 13:33 nodetool

./overlay/etc:
total 16
-rw-r--r-- 1 iw iw 334 13 Jan 13:33 app.config
-rw-r--r-- 1 iw iw 423 13 Jan 13:33 vm.args

To produce a release:

Add the following to rebar.config:

{sub_dirs, ["rel"]}.

and perform:

1

2
$
 ./rebar generate
==> rel (generate)

This will produce the target system exemplar within the rel directory:

1

2
3
4
5
6
7
8
9
$
 ls -l rel/exemplar/
total 0
drwxr-xr-x 3 iw iw 102 13 Jan 13:52 bin
drwxr-xr-x 8 iw iw 272 13 Jan 13:52 erts-5.7.4
drwxr-xr-x 3 iw iw 102 13 Jan 13:52 erts-vsn
drwxr-xr-x 4 iw iw 136 13 Jan 13:52 etc
drwxr-xr-x 33 iw iw 1122 13 Jan 13:52 lib
drwxr-xr-x 3 iw iw 102 13 Jan 13:52 log
drwxr-xr-x 4 iw iw 136 13 Jan 13:52 releases

你可能感兴趣的:(erlang,application,System,Build,templates,variables)