Skip to content

Instantly share code, notes, and snippets.

@dobladez
Created February 22, 2013 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dobladez/5014457 to your computer and use it in GitHub Desktop.
Save dobladez/5014457 to your computer and use it in GitHub Desktop.
My attempt at deploying lein app to VirtualBox via Pallet
(ns coral-deploy.pallet8
"Node defintions"
(:require
[pallet.api :as api]
[pallet.configure :as configure]
[pallet.actions :as action]
[pallet.crate.automated-admin-user :as admin-user]
[pallet.compute.vmfest :as vbox]
[pallet.crate.java :as java]
[pallet.crate.lein :as lein]
[pallet.crate :as crate]
))
;; Initialize pallet-vmfest (support for VirtualBox)
(def virtualbox (configure/compute-service "vmfest" nil nil))
(defn create-vbox-images
"Define a model image for VMFest
I *guess* this is only needed once per VirtualBox installation.
Check results with: (pallet.compute/images virtualbox)"
[]
(vbox/add-image virtualbox "/home/ferd/VMs/ubuntu-12.04.vdi.gz"))
(def default-node-spec
(api/node-spec :image {:os-family :ubuntu
:os-64-bit? true }
:hardware {:smallest true}))
(def base-server
(api/server-spec
:phases
{:bootstrap (api/plan-fn
(admin-user/automated-admin-user)
)}))
(def coral-server
(api/server-spec
:extends [(java/java {})
(lein/leiningen {:version "stable"})]
:phases
{:configure (api/plan-fn ;; Add your crates here:
(action/package-manager :update)
(lein/install-lein)
(action/remote-file "/tmp/testing.pallet" :content "Some content", :owner "root")
; (action/remote-directory "/usr/local/coral" :local-file "/home/ferd/projects/Reef/reef/coral-latest.tar.gz" )
(action/remote-directory "/tmp/target" :local-file "/tmp/target.tar.gz" )
; (java/install-java)
)}))
(def coral-web-cluster
(api/group-spec
"coral"
:extends [base-server coral-server]
:node-spec default-node-spec))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment