From 0622260ab677493128e13a98959f69735e6fdd29 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Fri, 19 Sep 2014 18:25:53 +0200 Subject: Release management --- Makefile | 8 ++++++++ ebin/catlfish.app | 7 +++---- makerelease.erl | 7 +++++++ reltool.config | 16 ++++++++++++++++ src/catlfish_app.erl | 29 +++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+), 4 deletions(-) create mode 100755 makerelease.erl create mode 100644 reltool.config create mode 100644 src/catlfish_app.erl diff --git a/Makefile b/Makefile index 2efdd34..bdfb49f 100644 --- a/Makefile +++ b/Makefile @@ -2,3 +2,11 @@ build all: erl -make clean: -rm ebin/*.beam +release: + rm -rf rel + mkdir rel + ./makerelease.erl + (cd rel ; ln -s ../../plop/Mnesia.nonode@nohost . ; ln -s ../../plop/test .) + cp httpd_props.conf rel + mkdir rel/catlfish + cp -r webroot rel/catlfish diff --git a/ebin/catlfish.app b/ebin/catlfish.app index 4dbb166..5e3b7ee 100644 --- a/ebin/catlfish.app +++ b/ebin/catlfish.app @@ -7,7 +7,6 @@ {application, catlfish, [{description, "catlfish -- Certificate Transparency Log Server"}, {vsn, "0.1.1"}, - {modules, [v1]}, - {applications, [kernel, stdlib, plop, inets]}]}. -%% {registered, [catlfish]}]}. -%% {mod, {catlfish, ["test/eckey.pem", "test/eckey-public.pem"]}}]}. + {modules, [v1, catlfish_app]}, + {applications, [kernel, stdlib, plop, inets, jiffy]}, + {mod, {catlfish_app, []}}]}. diff --git a/makerelease.erl b/makerelease.erl new file mode 100755 index 0000000..f72fdb6 --- /dev/null +++ b/makerelease.erl @@ -0,0 +1,7 @@ +#!/usr/bin/env escript +%% -*- erlang -*- + +main(_) -> + {ok, Conf} = file:consult("reltool.config"), + {ok, Spec} = reltool:get_target_spec(Conf), + ok = reltool:eval_target_spec(Spec, code:root_dir(), "rel"). diff --git a/reltool.config b/reltool.config new file mode 100644 index 0000000..1f7297e --- /dev/null +++ b/reltool.config @@ -0,0 +1,16 @@ +%% -*- mode: erlang -*- +{sys, [ + {lib_dirs, [".."]}, + {erts, [{mod_cond, derived}, {app_file, strip}]}, + {app_file, strip}, + {rel, "catlfish", "1.0.0", + [ + kernel, + stdlib, + sasl, + catlfish + ]}, + {boot_rel, "catlfish"}, + {app, catlfish, [{app_file, all}]} +%% {app, plop, [{mod_cond, app}, {incl_cond, include}, {lib_dir, "../plop"}]} + ]}. diff --git a/src/catlfish_app.erl b/src/catlfish_app.erl new file mode 100644 index 0000000..f4b67ad --- /dev/null +++ b/src/catlfish_app.erl @@ -0,0 +1,29 @@ +-module(catlfish_app). + +-behaviour(application). + +%% Application callbacks +-export([start/2, stop/1]). + +%% =================================================================== +%% Application callbacks +%% =================================================================== + +dummy() -> + receive + after + infinity -> + none + end. + +start(_StartType, _StartArgs) -> + io:format("starting catlfish~n", []), + InetsResult = inets:start(httpd, [{proplist_file, "httpd_props.conf"}]), + io:format("catlfish: tried to start inets service:~p~n", [InetsResult]), + Pid = spawn(fun () -> + dummy() + end), + {ok, Pid}. + +stop(_State) -> + ok. -- cgit v1.1