Commits

dizzyd committed 8f8a2f7

Refactoring makefile to use new overlay functionality for generating dev releases

Comments (0)

Files changed (4)

 
 devrel: dev1 dev2 dev3
 
-dev: 
-	mkdir dev
-	cp -R rel/overlay rel/reltool.config dev
-	./rebar compile && cd dev && ../rebar generate
-
-dev1 dev2 dev3: dev
-	yes n | cp -Ri dev/riak dev/$@
-	rm -rf dev/$@/data
-	mkdir -p dev/$@/data/ring
-	$(foreach app,$(wildcard apps/*), rm -rf dev/$@/lib/$(shell basename $(app))* && ln -sf $(abspath $(app)) dev/$@/lib;)
-	$(foreach dep,$(wildcard deps/*), rm -rf dev/$@/lib/$(shell basename $(dep))* && ln -sf $(abspath $(dep)) dev/$@/lib;)
-	perl -pi -e 's/name riak/name $@/g' dev/$@/etc/vm.args
-	perl -pi -e 's/web_port, \d+/web_port, 809$(subst dev,,$@)/g' \
-                    dev/$@/etc/app.config
-	perl -pi -e 's/pb_port, \d+/pb_port, 808$(subst dev,,$@)/g' \
-                    dev/$@/etc/app.config
-	perl -pi -e 's/handoff_port, \d+/handoff_port, 810$(subst dev,,$@)/g' \
-                    dev/$@/etc/app.config
+dev1 dev2 dev3:
+	mkdir -p dev
+	(cd rel && ../rebar generate target_dir=../dev/$@ overlay_vars=vars/$@_vars.config)
 
 devclean: clean
 	rm -rf dev

rel/vars/dev1_vars.config

+%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ts=4 sw=4 et
+
+%%
+%% etc/app.config
+%%
+{web_ip,       "127.0.0.1"}.
+{web_port,     8098}.
+{handoff_port, 8099}.
+{pb_ip,        "127.0.0.1"}.
+{pb_port,      8087}.
+
+%%
+%% etc/vm.args
+%%
+{node,         "dev1@127.0.0.1"}.
+
+%%
+%% bin/riak
+%%
+{runner_script_dir,  "$(cd ${0%/*} && pwd)"}.
+{runner_base_dir,    "${RUNNER_SCRIPT_DIR%/*}"}.
+{runner_etc_dir,     "$RUNNER_BASE_DIR/etc"}.
+{runner_log_dir,     "$RUNNER_BASE_DIR/log"}.
+{pipe_dir,           "/tmp/$RUNNER_BASE_DIR/"}.
+{runner_user,        ""}.

rel/vars/dev2_vars.config

+%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ts=4 sw=4 et
+
+%%
+%% etc/app.config
+%%
+{web_ip,       "127.0.0.1"}.
+{web_port,     8100}.
+{handoff_port, 8101}.
+{pb_ip,        "127.0.0.1"}.
+{pb_port,      8088}.
+
+%%
+%% etc/vm.args
+%%
+{node,         "dev2@127.0.0.1"}.
+
+%%
+%% bin/riak
+%%
+{runner_script_dir,  "$(cd ${0%/*} && pwd)"}.
+{runner_base_dir,    "${RUNNER_SCRIPT_DIR%/*}"}.
+{runner_etc_dir,     "$RUNNER_BASE_DIR/etc"}.
+{runner_log_dir,     "$RUNNER_BASE_DIR/log"}.
+{pipe_dir,           "/tmp/$RUNNER_BASE_DIR/"}.
+{runner_user,        ""}.

rel/vars/dev3_vars.config

+%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ts=4 sw=4 et
+
+%%
+%% etc/app.config
+%%
+{web_ip,       "127.0.0.1"}.
+{web_port,     8102}.
+{handoff_port, 8103}.
+{pb_ip,        "127.0.0.1"}.
+{pb_port,      8089}.
+
+%%
+%% etc/vm.args
+%%
+{node,         "dev3@127.0.0.1"}.
+
+%%
+%% bin/riak
+%%
+{runner_script_dir,  "$(cd ${0%/*} && pwd)"}.
+{runner_base_dir,    "${RUNNER_SCRIPT_DIR%/*}"}.
+{runner_etc_dir,     "$RUNNER_BASE_DIR/etc"}.
+{runner_log_dir,     "$RUNNER_BASE_DIR/log"}.
+{pipe_dir,           "/tmp/$RUNNER_BASE_DIR/"}.
+{runner_user,        ""}.