PageRenderTime 36ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 18ms app.codeStats 0ms

/src/clj/backtype/storm/crate/leiningen.clj

http://github.com/nathanmarz/storm-deploy
Clojure | 21 lines | 17 code | 2 blank | 2 comment | 0 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
 6;; this is 1.5.2. freezing version to ensure deploy is stable
 7(def download-lein1-url "https://raw.github.com/technomancy/leiningen/a1fa43400295d57a9acfed10735c1235904a9407/bin/lein")
 8;; this is 2.3.2. freezing version to ensure deploy is stable 
 9(def download-lein2-url "https://raw.github.com/technomancy/leiningen/7d7426b14326fc5257d82d97c314e2ea8455597e/bin/lein")
10
11(defn install [request version]
12  (let [download-url (if (= version 1) download-lein1-url download-lein2-url)]
13    (-> request
14      (remote-file/remote-file
15       "/usr/local/bin/lein"
16       :url download-url
17       :owner "root"
18       :mode 755)
19      (exec-script/exec-script
20       (export "LEIN_ROOT=1")
21       ("/usr/local/bin/lein")))))