mmcgrana/fleetdb

Feature request: lein-fleetdb plugin

Opened this issue · 2 comments

It would be nice to start the fleetdb server by just running a lein command:

$ lein fleetdb

And possibly have fleetdb parameters in the developer's project.clj file. Maybe something like this:

(defproject demo/demo "1.0.0-SNAPSHOT"
    :description "FIXME: write"
    :dependencies [[org.clojure/clojure "1.1.0-master-SNAPSHOT"]
        [org.clojure/clojure-contrib "1.0-SNAPSHOT"]
        [swank-clojure "1.1.0"]
        [fleetdb "0.1.1-SNAPSHOT"]
        [fleetdb-client "0.1.1-SNAPSHOT"]]
    :dev-dependencies [[leiningen/lein-swank "1.1.0"]]
    :fleetdb-logfile "demo.fdb"
    :fleetdb-port 3401)

And maybe even allow the developer to use lein to start the server with optional parameters to override the fleetdb settings in project.clj:

$ lein fleetdb -a 10.10.0.17 -p 3402

Then people won't have to type long commands or write their own scripts to start the server. If I get time and no one has created this yet, I might look into doing it myself (I don't think it would be much more complicated than the lein-swank plugin).

I like the idea of being able to specify a "configuration file", but I don't want to combine server configuration and booting with dependency specification and the build system.

So if you were going to write a patch along these lines, I'd suggest that you add a "-c" command line option that took the location of a configuration file, which would be read, evaled, and return a Clojure map. These configuration values would then be c.c./merge'd with any overrides / additions specified on the command line to give the boot configuration.

That would solve the issue of the command line flag verbosity, but not of the JVM startup verbosity, e.g. "java [jvm-opts] -cp fleetdb-standalone.jar fleetdb.server". I think this is an orthogonal issue and am open to ideas on how to solve it.

Very good points I hadn't considered!