A Leiningen plugin for building simple packages using fpm.
Generated packages install a standalone JAR for your project in /usr/lib
, a
wrapper shell script in /usr/bin
, and an upstart script in /etc/init
.
lein-fpm assumes that your project can successfully build a functioning
standalone jar via lein uberjar
.
Put [lein-fpm "0.2.3"]
into the :plugins
vector of your :user
profile.
Put [lein-fpm "0.2.3"]
into the :plugins
vector of your project.clj.
lein-fpm will produce a deb by default:
$ lein fpm
or you can supply a specific target type:
$ lein fpm rpm
This will produce a package in the target
directory.
By default, deb packages will depend on openjdk-7-jre-headless
, rpm packages
will depend on java-1.7.0-openjdk
, and solaris packages will depend on
jdk-7
.
Install the package using the appropriate package manager, then start the application with upstart:
$ sudo start APP-NAME
APP-NAME start/running, process 27699
$ status APP-NAME
APP-NAME start/running, process 27699
$ sudo restart APP-NAME
APP-NAME start/running, process 27743
$ sudo stop APP-NAME
APP-NAME stop/waiting
At the moment, lein-fpm is quite simple and does not yet support configuration beyond the target type. Contributions and feedback are welcome! This project is a bit of an experimental tool I created in trying to produce the simplest packages that will usefully run within immutable servers.
This plugin depends on fpm, and rpmbuild if you are creating rpms.
Copyright © 2015 Brian Schroeder
Distributed under the MIT License.