aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2023-07-26 03:02:09 +0200
committerAlexander Couzens <lynxis@fe80.eu>2023-11-10 13:19:20 +0100
commitcdd84e4a5a7cf7bccb3c5492ea1ec5a5ab5ab6ec (patch)
treed67bc891fa850f7287a8c9f80184f1447c2e34a2
parentbe945307eb8b41a338e27a57fc5a3e833207a6fe (diff)
rebar3: define a release
Further with the release, rebar3 will also start the application when calling `rebar3 shell`. Change-Id: I76cb16e28b5bc6fb231566be1bd7905235fdf56b
-rw-r--r--README.md13
-rw-r--r--contrib/systemd/osmo_dia2gsup.service2
-rw-r--r--rebar.config9
3 files changed, 15 insertions, 9 deletions
diff --git a/README.md b/README.md
index 8d8dc01..76d7a95 100644
--- a/README.md
+++ b/README.md
@@ -27,20 +27,12 @@ Once osmo\_dia2gsup is built, you can start it this way:
```
$ 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 @@ Running it as an escript:
$ 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..2ef737c 100644
--- a/contrib/systemd/osmo_dia2gsup.service
+++ b/contrib/systemd/osmo_dia2gsup.service
@@ -9,7 +9,7 @@ Type=simple
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 foreground
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}]}.