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-19 18:25:53 +0200
commit90af53429cce94dee753441b780a9cf050f5fced (patch)
treeed3859b9d4d18f407e17bd19dcac0d5f563f16d2
parentb9dfa6adff4fbfd68b7a3d7477f0f410e8620e15 (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 b93ac6d..e1807c5 100644
--- a/ebin/catlfish.app
+++ b/ebin/catlfish.app
@@ -7,7 +7,6 @@
{application, catlfish,
[{description, "catlfish -- Certificate Transparency Log Server"},
{vsn, "0.0.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.