Skip to content

Commit

Permalink
Conditional build with sd_notify library
Browse files Browse the repository at this point in the history
  • Loading branch information
vstax authored and mocchira committed Dec 21, 2017
1 parent cfa5ad0 commit e6e70cf
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ rel/leo_manager/files/leo_manager.schema
# ignore this because it is env dependent
rel/common/launch.environment

# reltool.config files are generated from reltool.config.in
rel/leo_gateway/reltool.config
rel/leo_manager/reltool.config
rel/leo_storage/reltool.config

apps/leo_gateway/cache/

docs/_book/
Expand Down
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,20 @@ generate:
(cd rel/leo_manager && ../../rebar generate)
(cd rel/leo_storage && ../../rebar generate)
(cd rel/leo_gateway && ../../rebar generate)
release:
sd_notify:
make -C deps/sd_notify
reltool:
ifeq ($(with_sd_notify),yes)
for reltool_config in rel/leo_*/reltool.config.in; do \
sed 's/%% SD_NOTIFY_PLACEHOLDER/,{app, sd_notify, [{incl_cond, include}]}/' \
$$reltool_config > $${reltool_config/.in/}; \
done
else
for reltool_config in rel/leo_*/reltool.config.in; do \
sed '/%% SD_NOTIFY_PLACEHOLDER/d' $$reltool_config > $${reltool_config/.in/}; \
done
endif
release: reltool
@./rebar compile
rm -rf package/leo_*
#
Expand Down
3 changes: 2 additions & 1 deletion apps/leo_gateway/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
{nfs_rpc_server, ".*", {git, "https://github.com/leo-project/nfs_rpc_server.git", {tag, "0.2.6"}}},
{cowboy, ".*", {git, "https://github.com/leo-project/cowboy.git", {branch, "for-leofs-1.4"}}},
{cowlib, ".*", {git, "https://github.com/ninenines/cowlib.git", {tag, "1.0.0"}}},
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}}
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}},
{sd_notify, ".*", {git, "https://github.com/systemd/erlang-sd_notify.git", {tag, "v1.0"}}, [raw]}
]}.

{erl_opts, [{d, 'NOTEST'},
Expand Down
3 changes: 2 additions & 1 deletion apps/leo_manager/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
{leo_statistics, ".*", {git, "https://github.com/leo-project/leo_statistics.git", {tag, "1.1.20"}}},
{leo_s3_libs, ".*", {git, "https://github.com/leo-project/leo_s3_libs.git", {tag, "1.2.16"}}},
{jiffy, ".*", {git, "https://github.com/davisp/jiffy.git", {tag, "0.14.8"}}},
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}}
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}},
{sd_notify, ".*", {git, "https://github.com/systemd/erlang-sd_notify.git", {tag, "v1.0"}}, [raw]}
]}.

{erl_opts, [{d, 'NOTEST'},
Expand Down
3 changes: 2 additions & 1 deletion apps/leo_storage/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
{leo_rpc, ".*", {git, "https://github.com/leo-project/leo_rpc.git", {tag, "0.10.15"}}},
{leo_statistics, ".*", {git, "https://github.com/leo-project/leo_statistics.git", {tag, "1.1.20"}}},
{leo_watchdog, ".*", {git, "https://github.com/leo-project/leo_watchdog.git", {tag, "1.0.4"}}},
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}}
{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.8.6"}}},
{sd_notify, ".*", {git, "https://github.com/systemd/erlang-sd_notify.git", {tag, "v1.0"}}, [raw]}
]}.

{erl_opts, [{d, 'NOTEST'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
{app, leo_watchdog, [{incl_cond, include}]},
{app, savanna_agent, [{incl_cond, include}]},
{app, savanna_commons, [{incl_cond, include}]}
%% SD_NOTIFY_PLACEHOLDER
]}.

{target_dir, "leo_gateway"}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
{app, leo_statistics, [{incl_cond, include}]},
{app, recon, [{incl_cond, include}]},
{app, savanna_commons, [{incl_cond, include}]}
%% SD_NOTIFY_PLACEHOLDER
]}.

{target_dir, "leo_manager"}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
{app, leo_watchdog, [{incl_cond, include}]},
{app, recon, [{incl_cond, include}]},
{app, savanna_commons, [{incl_cond, include}]}
%% SD_NOTIFY_PLACEHOLDER
]}.

{target_dir, "leo_storage"}.
Expand Down

0 comments on commit e6e70cf

Please sign in to comment.