Skip to content

Commit

Permalink
rebar3: Makefile make release
Browse files Browse the repository at this point in the history
`./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

`./dev/run` uses reltoo.config, while the rebar3 version uses `Relax`. Changed `couchdb` with `start` because it's hardcoded and relaxing.
  • Loading branch information
jiahuili430 committed Jul 20, 2022
1 parent 53c4e6e commit acb37f7
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
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_tests, 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, triq
]},

{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}" "$@"

0 comments on commit acb37f7

Please sign in to comment.