View Source ExFreeBSD
Helping Elixir mix releases become FreeBSD packages, since 2022.
Documentation: https://hexdocs.pm/freebsd
installation
Installation
You DO need elixir to build your release and package. You can install it with pkg install elixir.
You DO NOT need elixir to run your app, assuming your mix release configures include_erts: true (which is the default).
Add freebsd to your list of dependencies in mix.exs:
def deps do
[
{:freebsd, "~> 0.4.0", runtime: false}
]
endmix freebsd.gen.pkg- Edit
freebsd/*.eexas desired (particularly desc infreebsd/MANIFEST.eex - Add a
freebsdkey tomix.exsproject config.
def project do
[
# ExFreeBSD requires these standard keys:
app: :freebsd,
version: "0.4.0",
description: description(),
homepage_url: "https://github.com/patmaddox/ex_freebsd",
# and adds this one:
freebsd: freebsd()
]
end
defp freebsd do
[
maintainer: "pat@patmaddox.com",
description: description() # can be a multi-line string instead
]
end
usage
Usage
env MIX_ENV=prod mix freebsd.pkg will produce a FreeBSD .pkg file under freebsd/ which you can then install as usual.
freebsd/rc.eex produces /usr/local/etc/rc.d/<appname> which provides the following commands:
startstoprestartstatuspidremoteevalrpc
Run them using service(8).
After installing the package, you should define application-specific environment variables in /usr/local/etc/<appname>.conf.
roadmap
Roadmap
- list dependencies
- auto-name package w/ CI suffix:
<app>-ci-<branch>-<version>p<timestamp> - MANIFEST conflict for
<app> <app>-ci-* - run as non-privileged user