/src/clj/backtype/storm/crate/leiningen.clj
http://github.com/nathanmarz/storm-deploy · Clojure · 21 lines · 17 code · 2 blank · 2 comment · 2 complexity · 528ff72de19425bc17a8bb9314d0a80e MD5 · raw file
- (ns backtype.storm.crate.leiningen
- (:require
- [pallet.resource.remote-file :as remote-file]
- [pallet.action.exec-script :as exec-script]))
- ;; this is 1.5.2. freezing version to ensure deploy is stable
- (def download-lein1-url "https://raw.github.com/technomancy/leiningen/a1fa43400295d57a9acfed10735c1235904a9407/bin/lein")
- ;; this is 2.3.2. freezing version to ensure deploy is stable
- (def download-lein2-url "https://raw.github.com/technomancy/leiningen/7d7426b14326fc5257d82d97c314e2ea8455597e/bin/lein")
- (defn install [request version]
- (let [download-url (if (= version 1) download-lein1-url download-lein2-url)]
- (-> request
- (remote-file/remote-file
- "/usr/local/bin/lein"
- :url download-url
- :owner "root"
- :mode 755)
- (exec-script/exec-script
- (export "LEIN_ROOT=1")
- ("/usr/local/bin/lein")))))