25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Add support for rebar3 to "make rel"

This commit is contained in:
Badlop 2021-06-25 12:32:40 +02:00
parent 9d4c01d425
commit d5adcaea61
7 changed files with 73 additions and 5 deletions

View File

@ -123,10 +123,7 @@ jobs:
make update make update
make make
# Right now 'make rel' works only with rebar2, not rebar3
- run: make rel - run: make rel
if: matrix.rebar == 2
- run: make install -s - run: make install -s
- run: make hooks - run: make hooks
- run: make options - run: make options

View File

@ -107,6 +107,7 @@ ifeq "$(IS_REBAR3)" "1"
DEPSBASE=_build DEPSBASE=_build
DEPSDIR=$(DEPSBASE)/default/lib DEPSDIR=$(DEPSBASE)/default/lib
EBINDIR=$(DEPSDIR)/ejabberd/ebin EBINDIR=$(DEPSDIR)/ejabberd/ebin
REBARREL=as prod tar
else else
SKIPDEPS=skip_deps=true SKIPDEPS=skip_deps=true
LISTDEPS=-q list-deps LISTDEPS=-q list-deps
@ -115,6 +116,7 @@ else
DEPSBASE=deps DEPSBASE=deps
DEPSDIR=$(DEPSBASE) DEPSDIR=$(DEPSBASE)
EBINDIR=ebin EBINDIR=ebin
REBARREL=generate
endif endif
all: deps src all: deps src
@ -357,8 +359,8 @@ distclean: clean clean-rel
rm -f ejabberdctl.example ejabberd.init ejabberd.service rm -f ejabberdctl.example ejabberd.init ejabberd.service
[ ! -f ../ChangeLog ] || rm -f ../ChangeLog [ ! -f ../ChangeLog ] || rm -f ../ChangeLog
rel: all rel:
$(REBAR) generate $(REBAR) $(REBARREL)
TAGS: TAGS:
etags *.erl etags *.erl

View File

@ -172,6 +172,27 @@
{"fast_yaml", []}, {"fast_yaml", []},
{"stringprep", []}]}. {"stringprep", []}]}.
{relx, [{release, {ejabberd, {cmd, "grep {vsn, vars.config | sed 's|{vsn, \"||;s|\"}.||' | tr -d '\012'"}},
[ejabberd, odbc]},
{sys_config, "./rel/sys.config"},
{vm_args, "./rel/vm.args"},
{overlay_vars, "vars.config"},
{extended_start_script, true},
{overlay, [{mkdir, "var/log/ejabberd"},
{mkdir, "var/lock"},
{mkdir, "var/lib/ejabberd"},
{mkdir, "etc/ejabberd"},
{copy, "rel/files/erl", "\{\{erts_vsn\}\}/bin/erl"}, % in rebar2 this prepends erts-
{template, "ejabberdctl.template", "bin/ejabberdctl"},
{copy, "inetrc", "etc/ejabberd/inetrc"},
{copy, "rel/files/install_upgrade.escript", "bin/install_upgrade.escript"}]}
]}.
{profiles, [{prod, [{relx, [{mode, prod},
{overlay, [{copy, "sql/*", "lib/ejabberd-\{\{release_version\}\}/priv/sql/"},
{copy, "ejabberdctl.cfg.example", "etc/ejabberd/ejabberdctl.cfg"},
{copy, "ejabberd.yml.example", "etc/ejabberd/ejabberd.yml"}]}]}]},
{test, [{erl_opts, [nowarn_export_all]}]}]}.
%% Local Variables: %% Local Variables:
%% mode: erlang %% mode: erlang
%% End: %% End:

View File

@ -339,6 +339,14 @@ fun(Deps, FDeps) ->
end, Deps) end, Deps)
end, end,
ProcessRelx = fun(Relx, Deps) ->
{value, {release, NameVersion, DefaultApps}, RelxTail} = lists:keytake(release, 1, Relx),
DepApps = lists:map(fun({DepName, _, _}) -> DepName;
({DepName, _}) -> DepName
end, Deps),
[{release, NameVersion, DefaultApps ++ DepApps} | RelxTail]
end,
GithubConfig = case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of GithubConfig = case {os:getenv("GITHUB_ACTIONS"), os:getenv("GITHUB_TOKEN")} of
{"true", Token} when is_list(Token) -> {"true", Token} when is_list(Token) ->
CONFIG1 = [{coveralls_repo_token, Token}, CONFIG1 = [{coveralls_repo_token, Token},
@ -374,6 +382,8 @@ Rules = [
ProcessErlOpt, []}, ProcessErlOpt, []},
{[xref_queries], [xref_exclusions], true, {[xref_queries], [xref_exclusions], true,
AppendList2(ProcssXrefExclusions), [], []}, AppendList2(ProcssXrefExclusions), [], []},
{[relx], [deps], IsRebar3,
ProcessRelx, [], []},
{[deps], [floating_deps], true, {[deps], [floating_deps], true,
ProcessFloatingDeps, [], []}, ProcessFloatingDeps, [], []},
{[deps], [gitonly_deps], IsRebar3, {[deps], [gitonly_deps], IsRebar3,

2
rel/sys.config Normal file
View File

@ -0,0 +1,2 @@
[{ejabberd, [{config, "etc/ejabberd/ejabberd.yml"},
{log_path, "var/log/ejabberd/ejabberd.log"}]}].

32
rel/vm.args Normal file
View File

@ -0,0 +1,32 @@
## Name of the node
-sname ejabberd@localhost
## Cookie for distributed erlang
#-setcookie ejabberd
-mnesia dir \"var/lib/ejabberd\"
## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive
## (Disabled by default..use with caution!)
##-heart
## Enable kernel poll and a few async threads
##+K true
##+A 5
## Increase number of concurrent ports/sockets
##-env ERL_MAX_PORTS 4096
## Tweak GC to run more often
##-env ERL_FULLSWEEP_AFTER 10
# +B [c | d | i]
# Option c makes Ctrl-C interrupt the current shell instead of invoking the emulator break
# handler. Option d (same as specifying +B without an extra option) disables the break handler. # Option i makes the emulator ignore any break signal.
# If option c is used with oldshell on Unix, Ctrl-C will restart the shell process rather than
# interrupt it.
# Disable the emulator break handler
# it easy to accidentally type ctrl-c when trying
# to reach for ctrl-d. ctrl-c on a live node can
# have very undesirable results
##+Bi

View File

@ -20,10 +20,14 @@ Vars = case file:consult(filename:join([filename:dirname(SCRIPT), "..", "vars.co
cache_tab, cache_tab,
eimp, eimp,
fast_tls, fast_tls,
fast_xml,
fast_yaml, fast_yaml,
lager, lager,
p1_acme,
p1_utils, p1_utils,
pkix, pkix,
stringprep,
yconf,
xmpp]}, xmpp]},
{mod, {ejabberd_app, []}}]}. {mod, {ejabberd_app, []}}]}.