/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

  1. (ns backtype.storm.crate.leiningen
  2. (:require
  3. [pallet.resource.remote-file :as remote-file]
  4. [pallet.action.exec-script :as exec-script]))
  5. ;; this is 1.5.2. freezing version to ensure deploy is stable
  6. (def download-lein1-url "https://raw.github.com/technomancy/leiningen/a1fa43400295d57a9acfed10735c1235904a9407/bin/lein")
  7. ;; this is 2.3.2. freezing version to ensure deploy is stable
  8. (def download-lein2-url "https://raw.github.com/technomancy/leiningen/7d7426b14326fc5257d82d97c314e2ea8455597e/bin/lein")
  9. (defn install [request version]
  10. (let [download-url (if (= version 1) download-lein1-url download-lein2-url)]
  11. (-> request
  12. (remote-file/remote-file
  13. "/usr/local/bin/lein"
  14. :url download-url
  15. :owner "root"
  16. :mode 755)
  17. (exec-script/exec-script
  18. (export "LEIN_ROOT=1")
  19. ("/usr/local/bin/lein")))))