summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2014-09-19 18:25:53 +0200
committerMagnus Ahltorp <map@kth.se>2014-09-22 10:36:45 +0200
commit0622260ab677493128e13a98959f69735e6fdd29 (patch)
tree30f2ef2f826a7ceca83002a7b1628c5b0c81374a
parent813cddd87ffa18ffdc3ff6df54377bb0590fc445 (diff)
Release management
-rw-r--r--Makefile8
-rw-r--r--ebin/catlfish.app7
-rwxr-xr-xmakerelease.erl7
-rw-r--r--reltool.config16
-rw-r--r--src/catlfish_app.erl29
5 files changed, 63 insertions, 4 deletions
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.