Frage

I was reading about pallet here: http://twoguysarguing.wordpress.com/2010/11/01/starting-a-cluster-on-ec2-with-pallet/, as well as on the pallet site: http://palletops.com/. I'm still a little confused. The examples are arranged as if I'm expected to enter the code at a REPL.

But I think I'm missing something. Because I feel like (or I'm hoping) there should be some sort of lein support/integration, so that I can define some code to spin up a cluster, start the cluster, stop the cluster, deploy a war file, etc. via a series of lein commands.

I did find the following project on github, but it appears to be written to work with maven instead of lein: https://github.com/cemerick/clojure-web-deploy-conj.

And, this is very close to what I want, except that I want this tied into lein targets somehow: http://cemerick.com/2010/05/12/provisioning-administration-and-deployment-of-couchdb-java-tomcat/.

War es hilfreich?

Lösung

The Leiningen wiki refers to pallet/pallet-lein.

I don't have any experience with pallet, but it looks like the Leiningen plugin passes the first plugin argument to a function in the pallet.main namespace which appears to call into pallet.

So, the argument foo in lein pallet foo would be passed along to pallet.

Andere Tipps

So I found the following http://nakkaya.com/2010/02/25/writing-leiningen-plugins-101/, which describes the process for creating your own plugin. As it turns out it's fairly straightforward. Create a top level leiningen/ directory, give it a namespace name, and a function of the same name. And the function becomes a task in leiningen. So for example to provision a machine all I have to do is:

; In file leiningen/aws_provision.clj
(ns leiningen.aws-provision)

(defn aws-provision [project & args]
    (println "pallet code to provision the box here..."))

Then from the lein prompt I can do:

lein aws-provision

I guess pallet-lein isn't going to really be able to do what I want, because the details of which cloud provider, which machine size, which packages to install on the machine, etc. will be different for each person.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top