Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Upgrade to rebar3 3.18, with improvements in packaging and release assembly #1097

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
5ddfd28
nonexistent target ballclean
Dec 11, 2021
4ec03f3
determine otp version from erlang:system_info(otp_release)
Dec 14, 2021
df64555
upgrade rebar3 to 3.17 plus git revlist fix
Dec 10, 2021
73f12e9
upgrade rebar3_cuttlefish (to a version that supports fqdn data type)
Dec 11, 2021
3db7582
avoid copying .git dirs when preparing rel- targets
hmmr Dec 15, 2021
6976d5e
improvements in deb packaging (compliance with current standards, etc)
Dec 13, 2021
b5951f8
clean up after dropping yokozuna
Dec 13, 2021
10598c5
improvements in rpm packaging
Dec 14, 2021
d83d0ae
enable packaging for Amazon Linux 2
Dec 14, 2021
cb67886
osx package
Dec 24, 2021
debd415
cleaner su in launcher script
Dec 19, 2021
8b95c99
refactor and repair release assembly
Dec 19, 2021
9cb62b8
upgrade rebar3 to 3.18
Jan 2, 2022
88c76ff
rm node_package relic
Feb 4, 2022
9f25dab
alpine packaging groundwork
Feb 4, 2022
b052781
launcher without su, just for alpine
Feb 10, 2022
8009ff2
copy APKBUILD, with instruction on how to use it
Feb 10, 2022
9149d75
packaging for freebsd
Feb 19, 2022
2fa2d8b
use https:// when fetching github deps
hmmr Mar 22, 2022
48e829a
tmp repoint, bump lager_syslog
hmmr Mar 23, 2022
cfcacbc
Merge branch 'hmmr/develop-3.0/upgrade-to-rebar3.17' of github.com:TI…
hmmr Mar 23, 2022
ffb83b6
update rel/pkg/alpine/README
hmmr Mar 23, 2022
918f17b
more dependency bumps
hmmr Mar 23, 2022
e6f64bf
pre-create ./log in 'rel' release (fixes silent fail on first riak st…
hmmr Mar 26, 2022
bb10751
read release version from git tag
hmmr Mar 26, 2022
6ab6b0b
rm a leftover in rel/pkg/rpm
hmmr Mar 26, 2022
1ce0262
deprecate, warn about hyphenated forms of riak-admin
hmmr Mar 26, 2022
937e08d
pid file for local release is useless
Mar 28, 2022
c74a556
change to rebar3_cuttlefish-0.2.1 (0.2.0 with rebar3.18 API fix)
Mar 28, 2022
3628c74
riak_not_running is actually a template
Mar 28, 2022
5c0009e
let relx handle pid files (unbroken in rebar3_cuttlefish-0.2.1)
Mar 28, 2022
58b063a
rm leftover debian/riak.init
Mar 29, 2022
f75df62
rebar3.org recommends starting riak with 'foreground'
Mar 29, 2022
a50898f
tmp point rebar3_cuttlefish to a branch
Mar 29, 2022
4a3f0ff
missing items in debian/control BuildDepends
Mar 30, 2022
3140383
debian/Makefile: don't do make clean when nothing has been built yet
Mar 30, 2022
de4b6e9
deb/Makefile: link _build/default/{libs,plugins} to avoid fetching do…
Mar 30, 2022
36d6970
export RUNNER_LOG_DIR to unbreak cuttlefish-generated scripts
Mar 30, 2022
a6b196a
move hooks into own dir under rel/files
Mar 31, 2022
b03a592
why prepend riak- to PKG_ID?
Mar 31, 2022
f776cd7
symlnk deps from _build/default/lib/* into tree snapshot in rel/pkg/o…
Mar 31, 2022
8647c98
try explicit config/vm.args, to unbreak relx internode ops
Mar 31, 2022
323453d
amend de4b6e9a to only symlink libs (cuttlefish plugin fails unless r…
Mar 31, 2022
231d6f1
Merge branch 'hmmr/develop-3.0/fbsdng-support' into hmmr/develop-3.0/…
Apr 1, 2022
2afabb2
point deps to develop-3.0 branches
Apr 1, 2022
f0dc94c
tmp remove rebar.lock while deps are floated
Apr 2, 2022
332f71f
typo in rebar.config
Apr 4, 2022
e0b92c3
with rebar3_cuttlefish unbroken, undo hyphenated command routing
hmmr Apr 6, 2022
57314bd
make use of cf_config in riak-chkconfig, again
Apr 11, 2022
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
39 changes: 27 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PKG_REVISION ?= $(shell git describe --tags 2>/dev/null)
PKG_BUILD = 1
BASE_DIR = $(shell pwd)
ERLANG_BIN = $(shell dirname $(shell which erl 2>/dev/null) 2>/dev/null)
OTP_VER = $(shell echo $(ERLANG_BIN) | rev | cut -d "/" -f 2 | rev)
OTP_VER = $(shell erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell)
REBAR ?= $(BASE_DIR)/rebar3
OVERLAY_VARS ?=
TEST_IGNORE ?= lager riak basho_bench
Expand All @@ -30,12 +30,12 @@ compile:

deps:
$(if $(HEAD_REVISION),$(warning "Warning: you have checked out a tag ($(HEAD_REVISION)) and should use the compile target"))
$(REBAR) upgrade
$(REBAR) upgrade --all

clean: testclean
$(REBAR) clean

distclean: clean devclean relclean ballclean
distclean: clean devclean relclean
@rm -rf _build

##
Expand Down Expand Up @@ -74,20 +74,35 @@ test : testclean eunit test-deps
## Release targets
##
rel: compile
$(REBAR) as rel release
cp -a _build/rel/rel/riak rel/
@$(REBAR) as rel release
# freebsd tar won't write to stdout, so:
@tar -c -f rel.tar --exclude '*/.git/*' -C _build/rel/rel riak && tar -x -f rel.tar -C rel && rm rel.tar

rel-rpm: compile
$(REBAR) as rpm release
cp -a _build/rpm/rel/riak rel/
@$(REBAR) as rpm release
@tar --exclude-vcs -c -C _build/rpm/rel riak | tar -x -C rel

rel-deb: compile
$(REBAR) as deb release
cp -a _build/deb/rel/riak rel/
@$(REBAR) as deb release
@tar --exclude=vcs -c -C _build/deb/rel riak | tar -x -C rel

rel-osx: compile
@$(REBAR) as osx release
@tar --exclude=vcs -c -C _build/osx/rel riak | tar -x -C rel

# this one is to be called from an external make (not from rel/pkg/Makefile)
rel-alpine: compile
@$(REBAR) as alpine release
@(cd _build/alpine/rel/riak/usr/bin && mv riak-nosu riak)
@tar --exclude=vcs -c -C _build/alpine/rel riak | tar -x -C rel

rel-fbsdng: compile
@$(REBAR) as fbsdng release
@tar -c -f rel.tar --exclude '*/.git/*' -C _build/fbsdng/rel riak && tar -x -f rel.tar -C rel && rm rel.tar

relclean:
rm -rf $(REL_DIR)
rm -rf rel/riak
@rm -rf $(REL_DIR)
@rm -rf rel/riak rel/.libs rel/.deps

##
## Developer targets
Expand Down Expand Up @@ -231,7 +246,7 @@ PKG_ID := "$(REPO_TAG)-OTP$(OTP_VER)"
PKG_VERSION = $(shell echo $(PKG_ID) | sed -e 's/^$(REPO)-//')

package:
mkdir rel/pkg/out/riak-$(PKG_ID)
mkdir -p rel/pkg/out/$(PKG_ID)
git archive --format=tar HEAD | gzip >rel/pkg/out/$(PKG_ID).tar.gz
$(MAKE) -f rel/pkg/Makefile

Expand Down
2 changes: 2 additions & 0 deletions config/vm.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-setcookie riak
-name [email protected]
37 changes: 0 additions & 37 deletions pkg.vars.config

This file was deleted.

212 changes: 132 additions & 80 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
{eunit_opts, [nowarn_export_all, verbose]}.

{deps, [
{lager_syslog, {git, "https://github.com/basho/lager_syslog.git", {tag, "3.1.0"}}},
{cluster_info, {git, "https://github.com/basho/cluster_info.git", {tag, "2.1.0"}}},
{riak_kv, {git, "https://github.com/basho/riak_kv.git", {tag, "riak_kv-3.0.9"}}},
{riak_auth_mods, {git, "https://github.com/basho/riak_auth_mods.git", {tag, "riak_kv-3.0.0"}}},
{riaknostic, {git, "https://github.com/basho/riaknostic.git", {tag, "riak_kv-3.0.2"}}},
{lager_syslog, {git, "https://github.com/basho/lager_syslog.git", {branch, "develop-3.0"}}},
{cluster_info, {git, "https://github.com/basho/cluster_info.git", {branch, "develop-3.0"}}},
{riak_kv, {git, "https://github.com/basho/riak_kv.git", {branch, "develop-3.0"}}},
{riak_auth_mods, {git, "https://github.com/basho/riak_auth_mods.git", {branch, "develop-3.0"}}},
{riaknostic, {git, "https://github.com/basho/riaknostic.git", {branch, "develop-3.0"}}},

% {yokozuna, {git, "https://github.com/basho/yokozuna.git", {branch, "develop-3.0"}}},

{riak_repl, {git, "https://github.com/basho/riak_repl.git", {tag, "riak_kv-3.0.9"}}}
{riak_repl, {git, "https://github.com/basho/riak_repl", {branch, "develop-3.0"}}}
]}.

{project_plugins, [
{rebar3_cuttlefish, {git, "https://github.com/basho/rebar3_cuttlefish", {tag, "0.2.0"}}}
{rebar3_cuttlefish, {git, "https://github.com/basho/rebar3_cuttlefish", {branch, "develop-3.0"}}}
]}.

{cuttlefish, [
Expand All @@ -46,7 +46,7 @@
]}
]}.

{relx, [{release, {riak, "3.0.9"},
{relx, [{release, {riak, git},
[kernel,
stdlib,
lager,
Expand Down Expand Up @@ -82,6 +82,7 @@
{overlay, [
{mkdir, "lib/patches"},
{mkdir, "data/ring"},
{mkdir, "log"},

{template, "rel/files/advanced.config", "etc/advanced.config"},

Expand All @@ -92,90 +93,141 @@
{template, "rel/files/riak-repl", "bin/riak-repl"},
{template, "rel/files/riak", "usr/bin/riak"},

{copy, "rel/files/check_ulimit", "bin/hooks/check_ulimit"},
{copy, "rel/files/erl_maxlogsize", "bin/hooks/erl_maxlogsize"},
{copy, "rel/files/erl_codeloadingmode","bin/hooks/erl_codeloadingmode"},
{copy, "rel/files/riak_not_running", "bin/hooks/riak_not_running"},
{copy, "rel/files/app_epath.sh", "lib/app_epath.sh"}

{copy, "rel/files/hooks/check_ulimit", "bin/hooks/check_ulimit"},
{copy, "rel/files/hooks/erl_maxlogsize", "bin/hooks/erl_maxlogsize"},
{copy, "rel/files/hooks/erl_codeloadingmode","bin/hooks/erl_codeloadingmode"},
{template, "rel/files/hooks/riak_not_running", "bin/hooks/riak_not_running"},
{copy, "rel/files/app_epath.sh", "lib/app_epath.sh"}
]},

{generate_start_script, true},
{extended_start_script, true},
{extended_start_script_extensions, [
{admin, "riak-admin"},
{repl, "riak-repl"},
{debug, "riak-debug"},
{chkconfig, "riak-chkconfig"}
]}

]}.

{dialyzer, [{plt_apps, all_deps}]}.

{profiles, [
{rel, [
{relx, [
{overlay_vars, "rel/vars.config"},
{extended_start_script_hooks,
[{pre_start,
[{custom, "hooks/riak_not_running"},
{custom, "hooks/check_ulimit"},
{custom, "hooks/erl_maxlogsize"},
{custom, "hooks/erl_codeloadingmode"}]},
{post_start,
[{wait_for_process, riak_core_node_watcher}]}
]}
]}
]},
{dev, [{relx, [
{dev_mode, true},
{extended_start_script_hooks,
[{pre_start,
[{custom, "hooks/riak_not_running"},
{custom, "hooks/check_ulimit"},
{custom, "hooks/erl_maxlogsize"},
{custom, "hooks/erl_codeloadingmode"}]},
{post_start,
[{wait_for_process, riak_core_node_watcher}]}
]}
]}
]},
{rpm, [
{relx, [
{overlay_vars, "rel/pkg/rpm/vars.config"},
{overlay, [
{template, "rel/files/riak", "usr/sbin/riak"},
{template, "rel/pkg/rpm/init.script", "etc/init.d/init.script"}
]},
{extended_start_script_hooks,
[{pre_start,
[{custom, "hooks/riak_not_running"},
{custom, "hooks/check_ulimit"},
{custom, "hooks/erl_maxlogsize"},
{custom, "hooks/erl_codeloadingmode"}]},
{post_start,
[{pid, "/var/run/riak/riak.pid"},
{wait_for_process, riak_core_node_watcher}]}
]}
]}
]},
{deb, [
{relx, [
{overlay_vars, "debian/vars.config"},
{overlay, [
{template, "rel/files/riak", "usr/bin/riak"}
]},
{extended_start_script_hooks,
[{pre_start,
[{custom, "hooks/riak_not_running"},
{custom, "hooks/check_ulimit"},
{custom, "hooks/erl_maxlogsize"},
{custom, "hooks/erl_codeloadingmode"}]},
{post_start,
[wait_for_vm_start,
{pid, "/run/riak/riak.pid"},
{wait_for_process, riak_core_node_watcher}]}
]}
]}
]}
{profiles,
[{rel,
[{relx,
[{overlay_vars, "rel/vars.config"},
{extended_start_script_hooks,
[{pre_start,
[{custom, "hooks/riak_not_running"},
{custom, "hooks/check_ulimit"},
{custom, "hooks/erl_maxlogsize"},
{custom, "hooks/erl_codeloadingmode"}]},
{post_start,
[{wait_for_process, riak_core_node_watcher}
]}
]}
]}
]},

{dev,
[{relx,
[{dev_mode, true},
{extended_start_script_hooks,
[{pre_start,
[{custom, "hooks/riak_not_running"},
{custom, "hooks/check_ulimit"},
{custom, "hooks/erl_maxlogsize"},
{custom, "hooks/erl_codeloadingmode"}
]},
{post_start,
[{wait_for_process, riak_core_node_watcher}]}
]}
]}
]},

{rpm,
[{relx,
[{overlay_vars, "rel/pkg/rpm/vars.config"},
{overlay,
[{template, "rel/files/riak", "usr/sbin/riak"},
{template, "rel/pkg/rpm/init.script", "etc/init.d/init.script"}
]},
{extended_start_script_hooks,
[{pre_start,
[{custom, "hooks/riak_not_running"},
{custom, "hooks/check_ulimit"},
{custom, "hooks/erl_maxlogsize"},
{custom, "hooks/erl_codeloadingmode"}
]},
{post_start,
[{pid, "/var/run/riak/riak.pid"},
{wait_for_process, riak_core_node_watcher}]}
]}
]}
]},

{deb,
[{relx,
[{overlay_vars, "rel/pkg/deb/vars.config"},
{overlay,
[{template, "rel/files/riak", "usr/bin/riak"}
]},
{extended_start_script_hooks,
[{pre_start,
[{custom, "hooks/riak_not_running"},
{custom, "hooks/check_ulimit"},
{custom, "hooks/erl_maxlogsize"},
{custom, "hooks/erl_codeloadingmode"}
]},
{post_start,
[wait_for_vm_start,
{pid, "/run/riak/riak.pid"},
{wait_for_process, riak_core_node_watcher}]}
]}
]}
]},

{alpine,
[{relx,
[{overlay_vars, "rel/pkg/alpine/vars.config"},
{overlay,
[{template, "rel/pkg/alpine/riak-nosu", "usr/bin/riak-nosu"} %% to be renamed to riak in Makefile
]},
{extended_start_script_hooks,
[{pre_start,
[{custom, "hooks/riak_not_running"},
{custom, "hooks/check_ulimit"},
{custom, "hooks/erl_maxlogsize"},
{custom, "hooks/erl_codeloadingmode"}]},
{post_start,
[wait_for_vm_start,
{pid, "/run/riak/riak.pid"},
{wait_for_process, riak_core_node_watcher}]}
]}
]}
]},

{osx,
[{relx,
[{overlay_vars, "rel/pkg/osx/vars.config"}
]}
]},

{fbsdng,
[{relx,
[{overlay_vars, "rel/pkg/fbsdng/vars.config"},
{extended_start_script_hooks,
[{pre_start,
[{custom, "hooks/riak_not_running"},
{custom, "hooks/check_ulimit"},
{custom, "hooks/erl_maxlogsize"},
{custom, "hooks/erl_codeloadingmode"}]},
{post_start,
[wait_for_vm_start,
{pid, "/var/run/riak/riak.pid"},
{wait_for_process, riak_core_node_watcher}]}
]}
]}
]}
]}.
Loading