A Leiningen plugin that makes easy to deploy production code with the runit supervisor. If you’ve never used runit before, you may want to refer to Kevin Chard’s excellent quickstart. I have curated some more links in a blog post. Once you understand how things work, you may want to come back and use lein-runit to automate the workflow for Clojure projects.
Put the following into the :plugins vector in either project.clj or ~/.lein/profiles.clj.
[org.danielsz/lein-runit "0.1.0-SNAPSHOT"]
Define a :runit vector in your project.clj with the paths to your application root and service root paths. On debian, for example:
:runit {:app-root "/opt"
:service-root "/etc/sv"}
Since this plugin makes sense for production scenarii, this is most likely what you’ll want to issue at the command line:
$ lein with-profile production runit
Finally, change to the target directory, and run the shell script that will move everything into place with the right permissions:
$ cd target
$ ./commit.sh
The assumptions made by lein-runit are that:
- You are using the environ library to set the environment variables for your project.
- You are deploying an uberjar. (lein with-profile production uberjar)
Copyright © 2014 Daniel Szmulewicz
Distributed under the Eclipse Public License.