Skip to content
Draft

Rebar3 #4120

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
rebar3: Makefile make release
`./dev/run` is using `reltoo.config`
`rebar3 release` is using `relx`

For `make release`, changed `couchdb` with `start` because it's hardcoded
in relx. see https://github.com/erlware/relx/blob/main/src/rlx_assemble.erl#L828
  • Loading branch information
jiahuili430 committed Jul 22, 2022
commit 2b25e385fedf53df7989433374905205e67b28ce
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,12 @@ dist: all derived
release: all
@echo "Installing CouchDB into rel/couchdb/ ..."
@rm -rf rel/couchdb
@$(REBAR) generate # make full erlang release
@cp bin/weatherreport rel/couchdb/bin/weatherreport
@$(REBAR3) release # make full erlang release
@cp -r _build/default/rel/couchdb rel/couchdb

ifeq ($(with_fauxton), 1)
@mkdir -p rel/couchdb/share/
@cp -R share/www rel/couchdb/share/
@cp -R _build/default/share/www rel/couchdb/share/
endif

ifeq ($(with_docs), 1)
Expand All @@ -382,8 +382,8 @@ ifeq ($(IN_RELEASE), true)
else
@mkdir -p rel/couchdb/share/www/docs/
@mkdir -p rel/couchdb/share/docs/
@cp -R apps/docs/build/html/ rel/couchdb/share/www/docs
@cp apps/docs/build/man/apachecouchdb.1 rel/couchdb/share/docs/couchdb.1
@cp -R _build/default/lib/docs/build/html/ rel/couchdb/share/www/docs
@cp _build/default/lib/docs/build/man/apachecouchdb.1 rel/couchdb/share/docs/couchdb.1
endif
endif

Expand Down
43 changes: 42 additions & 1 deletion rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,48 @@ AddConfig = [
{plt_extra_apps, [
asn1, compiler, crypto, inets, kernel, runtime_tools,
sasl, setup, ssl, stdlib, syntax_tools, xmerl]},
{warnings, [unmatched_returns, error_handling, race_conditions]}]},
{warnings, [unmatched_returns, error_handling, race_conditions]}
]},
{relx, [
{release, {couchdb, "3.2.2"}, [
%% stdlib
asn1, compiler, crypto, inets, runtime_tools,
sasl, ssl, syntax_tools, xmerl,

%% couchdb
b64url, bear, chttpd, config, couch, couch_epi,
couch_index, couch_log, couch_mrview, couch_plugins,
couch_replicator, couch_stats, couch_event,
couch_peruser, couch_dist, custodian, ddoc_cache,
dreyfus, ets_lru, fabric, folsom, global_changes,
hyper, ibrowse, ioq, jiffy, jwtf, ken, khash, mango,
mem3, mochiweb, rexi, setup, smoosh, snappy,
weatherreport, couch_prometheus,

%% extra
recon
]},

{mode, prod},
{overlay_vars, "rel/couchdb.config"},
{sys_config, "rel/files/sys.config"},
{vm_args, "rel/files/vm.args"},
{check_for_undefined_functions, false},
{overlay, [
{copy, "LICENSE", "LICENSE"},
{mkdir, "var/log"},
{copy, "rel/overlay/bin", "bin"},
{copy, "rel/overlay/etc", "etc"},
{copy, "bin/couchjs", "bin/couchjs"},
{copy, "share/server/main.js", "share/rserver/main.js"},
{copy, "share/server/main-coffee.js", "share/server/main-coffee.js"},
{copy, "bin/weatherreport", "bin/weatherreport"},
{template, "rel/overlay/etc/default.ini", "etc/default.ini"},
{template, "rel/overlay/etc/vm.args", "etc/vm.args"},
{template, "rel/files/couchdb.in", "bin/couchdb"},
{template, "rel/files/couchdb.cmd.in", "bin/couchdb.cmd"}
]}
]},
{post_hooks, [{compile, "escript support/build_js.escript"}]}
].

Expand Down
2 changes: 1 addition & 1 deletion rel/files/couchdb.cmd.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ IF NOT DEFINED COUCHDB_QUERY_SERVER_JAVASCRIPT SET COUCHDB_QUERY_SERVER_JAVASCRI
IF NOT DEFINED COUCHDB_QUERY_SERVER_COFFEESCRIPT SET COUCHDB_QUERY_SERVER_COFFEESCRIPT={{prefix}}/bin/couchjs {{prefix}}/share/server/main-coffee.js
IF NOT DEFINED COUCHDB_FAUXTON_DOCROOT SET COUCHDB_FAUXTON_DOCROOT={{fauxton_root}}

"%BINDIR%\erl" -boot "%ROOTDIR%\releases\%APP_VSN%\couchdb" ^
"%BINDIR%\erl" -boot "%ROOTDIR%\releases\%APP_VSN%\start" ^
-args_file "%ROOTDIR%\etc\vm.args" ^
-epmd "%BINDIR%\epmd.exe" ^
-config "%ROOTDIR%\releases\%APP_VSN%\sys.config" %*
Expand Down
2 changes: 1 addition & 1 deletion rel/files/couchdb.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ARGS_FILE="${COUCHDB_ARGS_FILE:-$ROOTDIR/etc/vm.args}"
[ -n "${COUCHDB_INI_FILES:-}" ] && INI_ARGS="-couch_ini $COUCHDB_INI_FILES"
SYSCONFIG_FILE="${COUCHDB_SYSCONFIG_FILE:-$ROOTDIR/releases/$APP_VSN/sys.config}"

exec "$BINDIR/erlexec" -boot "$ROOTDIR/releases/$APP_VSN/couchdb" \
exec "$BINDIR/erlexec" -boot "$ROOTDIR/releases/$APP_VSN/start" \
-args_file "${ARGS_FILE}" \
${INI_ARGS:-} \
-config "${SYSCONFIG_FILE}" "$@"
6 changes: 2 additions & 4 deletions rel/reltool.config
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
couch_prometheus,

%% extra
recon,
triq
recon
]},
{rel, "start_clean", "", [kernel, stdlib]},
{boot_rel, "couchdb"},
Expand Down Expand Up @@ -131,8 +130,7 @@
{app, couch_prometheus, [{incl_cond, include}]},

%% extra
{app, recon, [{incl_cond, include}]},
{app, triq, [{incl_cond, include}]}
{app, recon, [{incl_cond, include}]}
]}.

{overlay_vars, "couchdb.config"}.
Expand Down