lynxis lazus has uploaded this change for review.

View Change

rebar3: define a release

Further with the release, rebar3 will also start the application
when calling `rebar3 shell`.

Change-Id: I76cb16e28b5bc6fb231566be1bd7905235fdf56b
---
M README.md
M contrib/systemd/osmo_dia2gsup.service
M rebar.config
3 files changed, 27 insertions(+), 9 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/erlang/osmo_dia2gsup refs/changes/84/34284/1
diff --git a/README.md b/README.md
index 8d8dc01..76d7a95 100644
--- a/README.md
+++ b/README.md
@@ -27,20 +27,12 @@

```
$ rebar3 shell
-1> osmo_dia2gsup:start().
```

Passing a config file:

```
$ rebar3 shell --config ./examples/sys.config
-1> osmo_dia2gsup:start().
-```
-
-Running it with one shell command:
-
-```
-$ rebar3 shell --config ./examples/sys.config --eval "osmo_dia2gsup:start()."
```

Running it as an escript:
@@ -49,3 +41,8 @@
$ rebar3 escriptize
$ ERL_FLAGS='-config ./examples/sys.config' _build/default/bin/osmo-dia2gsup
```
+
+## Build a new release
+
+rebar3 release
+
diff --git a/contrib/systemd/osmo_dia2gsup.service b/contrib/systemd/osmo_dia2gsup.service
index b57247b..d2347bd 100644
--- a/contrib/systemd/osmo_dia2gsup.service
+++ b/contrib/systemd/osmo_dia2gsup.service
@@ -9,7 +9,7 @@
Restart=always
Environment="HOME=/var/lib/osmo_dia2gsup"
ExecStartPre=/usr/bin/mkdir -p /var/lib/osmo_dia2gsup
-ExecStart=/usr/bin/osmo-dia2gsup
+ExecStart=/usr/bin/osmo-dia2gsup forground
RestartSec=2

[Install]
diff --git a/rebar.config b/rebar.config
index 69013aa..3bda3e5 100644
--- a/rebar.config
+++ b/rebar.config
@@ -33,3 +33,12 @@
{escript_incl_apps, [osmo_dia2gsup]}.
{escript_main_app, osmo_dia2gsup}.
{escript_name, "osmo-dia2gsup"}.
+
+{relx,
+ [{release, {'osmo-dia2gsup', {git, long}},
+ [osmo_dia2gsup]},
+ {sys_config, "./config/sys.config"},
+ {vm_args, "./config/vm.args"},
+ {dev_mode, false},
+ {include_erts, true},
+ {extended_start_script, true}]}.

To view, visit change 34284. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: erlang/osmo_dia2gsup
Gerrit-Branch: master
Gerrit-Change-Id: I76cb16e28b5bc6fb231566be1bd7905235fdf56b
Gerrit-Change-Number: 34284
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis@fe80.eu>
Gerrit-MessageType: newchange