Skip to content

Instantly share code, notes, and snippets.

@tbatchelli
Created November 8, 2010 20:19
Show Gist options
  • Save tbatchelli/668197 to your computer and use it in GitHub Desktop.
Save tbatchelli/668197 to your computer and use it in GitHub Desktop.
;;;;;;;;;;;;
;; pallet ;;
;;;;;;;;;;;;
(ns bacug-haproxy
(:use pallet.maven
[pallet.compute :as compute])
(:require webapp-nodes.nodes))
;; define the compute service, this time form maven settings
(def service (compute-service-from-settings))
;; create one node in the 'proxied' tag
(pallet.core/converge
{webapp-nodes.nodes/proxied 1}
:compute service :phase [:deploy-nano-webapp :restart-tomcat])
;; SSH in!
;; deploy a webapp on the nodes in the 'proxied' tag
(pallet.core/lift webapp-nodes.nodes/proxied :compute service :phase :deploy-nano-webapp)
;; make the deploy faster --> use a blobstore!
(def blobstore (pallet.blobstore/blobstore-from-settings))
;;;;; remember to update the proxied crate
;; deploy 3 proxied nodes with webapp + 1 haproxy,
(pallet.core/converge
{webapp-nodes.nodes/proxied 2
webapp-nodes.nodes/haproxy 1}
:compute service
:blobstore blobstore
:phase [:deploy-from-blobstore :restart-haproxy :restart-tomcat])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment