Additional fixes and modification

- Updating documentation to be more accurate
- Style fixes
- More precise error messages
This commit is contained in:
Fred Hebert 2014-11-21 10:11:13 -05:00
parent b41086ba98
commit c54d496030
2 changed files with 13 additions and 8 deletions

View file

@ -111,13 +111,13 @@ get_rel_file_path(Name, Path) ->
get_rel_file_path(Name, Path, PVer). get_rel_file_path(Name, Path, PVer).
get_rel_file_path(Name, Path, Version) -> get_rel_file_path(Name, Path, Version) ->
Dir = filename:join([Path, "releases", Version]), Dir = filename:join([Path, "releases", Version]),
Path1 = filename:join([Dir, Name ++ "_" ++ Version ++".rel"]), Path1 = filename:join([Dir, Name ++ "_" ++ Version ++".rel"]),
Path2 = filename:join([Dir, Name ++ ".rel"]), Path2 = filename:join([Dir, Name ++ ".rel"]),
case {filelib:is_file(Path1), filelib:is_file(Path2)} of case {filelib:is_file(Path1), filelib:is_file(Path2)} of
{true, _} -> Path1; {true, _} -> Path1;
{_, true} -> Path2; {_, true} -> Path2;
_ -> ?ABORT("can not find .rel file for version ~p", [Version]) _ -> ?ABORT("can not find .rel file for version ~p~n", [Version])
end. end.
%% Get the previous release path from a global variable %% Get the previous release path from a global variable
@ -138,7 +138,7 @@ load_config(Config, ReltoolFile) ->
{ok, Terms} -> {ok, Terms} ->
expand_version(Config, Terms, filename:dirname(ReltoolFile)); expand_version(Config, Terms, filename:dirname(ReltoolFile));
Other -> Other ->
?ABORT("Failed to load expected config from ~s: ~p\n", ?ABORT("Failed to load expected config from ~s: ~p~n",
[ReltoolFile, Other]) [ReltoolFile, Other])
end. end.
@ -151,7 +151,7 @@ get_sys_tuple(ReltoolConfig) ->
{sys, _} = SysTuple -> {sys, _} = SysTuple ->
SysTuple; SysTuple;
false -> false ->
?ABORT("Failed to find {sys, [...]} tuple in reltool.config.", []) ?ABORT("Failed to find {sys, [...]} tuple in reltool.config~n", [])
end. end.
%% %%
@ -265,5 +265,5 @@ get_permanent_version(Path) ->
" "), " "),
Version; Version;
{error, enoent} -> {error, enoent} ->
?ABORT("start_erl.data is missing", []) ?ABORT("~s is missing~n", [DataFile])
end. end.

View file

@ -1,7 +1,9 @@
#### Building version 0.1 #### Building version 0.1
rebar compile rebar compile
cd rel
rebar generate rebar generate
mv rel/dummy rel/dummy_0.1 mv dummy dummy_0.1
cd ..
rebar clean rebar clean
# start the release: # start the release:
cd rel/dummy_0.1 cd rel/dummy_0.1
@ -20,15 +22,17 @@
$EDITOR rel/reltool.config $EDITOR rel/reltool.config
rebar compile rebar compile
cd rel
rebar generate rebar generate
# previous_release path is relative to your rel directory # previous_release path is relative to your rel directory
rebar generate-appups previous_release=dummy_0.1 rebar generate-appups previous_release=dummy_0.1
rebar generate-upgrade previous_release=dummy_0.1 rebar generate-upgrade previous_release=dummy_0.1
tar -zvtf rel/dummy_0.2.tar.gz tar -zvtf dummy_0.2.tar.gz
mv dummy dummy_0.2
#### Deploying with release_handler #### Deploying with release_handler
mv rel/dummy_0.2.tar.gz rel/dummy_0.1/releases/ mv dummy_0.2.tar.gz dummy_0.1/releases/
# Now use release_handler in the running erlang console for the deploy: # Now use release_handler in the running erlang console for the deploy:
@ -43,3 +47,4 @@
rm -r rel/dummy rm -r rel/dummy
# Now repeat steps in 'Building version 0.2' and 'Deploying with release_handler' # Now repeat steps in 'Building version 0.2' and 'Deploying with release_handler'
# while replacing '0.2' by '0.3' and '0.1' by '0.2'.