This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn postgresql-script | |
"Execute a postgresql script. | |
Options for how this script should be run: | |
:as-user username - Run this script having sudoed to this (system) user. Default: postgres" | |
[request sql-script & {:keys [as-user ignore-result] | |
:as options | |
:or {as-user "postgres"}}] | |
(-> request | |
(exec-script/exec-checked-script | |
"PostgreSQL temp command file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defproject mini-webapp "1.0.0-SNAPSHOT" | |
:description "mini-webapp" | |
:aot [mini-webapp.Servlet] | |
:dependencies [[org.clojure/clojure "1.2.0"] | |
[org.clojure/clojure-contrib "1.2.0"] | |
[ring "0.2.6"]] | |
:dev-dependencies [[uk.org.alienscience/leiningen-war "0.0.7"] | |
[swank-clojure/swank-clojure "1.2.1"] | |
[org.cloudhoist/pallet-lein "0.2.0-SNAPSHOT"] | |
[org.cloudhoist/pallet "0.3.0-SNAPSHOT"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for provider in $*; do | |
echo "Running $provider" | |
echo " creating node" | |
lein pallet -P $provider converge webapp-nodes.nodes/proxied 1 webapp-nodes.nodes/haproxy 1 | |
echo " deploying node" | |
lein pallet -P $provider lift webapp-nodes.nodes/proxied :deploy-nano-webapp | |
lein pallet -P $provider lift webapp-nodes.nodes/proxied :deploy-mini-webapp | |
lein pallet -P $provider lift webapp-nodes.nodes/proxied :deploy-from-blobstore | |
echo " removing node" | |
lein pallet -P $provider converge webapp-nodes.nodes/proxied 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.jclouds.compute.RunNodesException: error running 1 node tag(webapp) location(DFW1) image(49) size(1) options([inboundPorts=[22, 8080, 8080], privateKey=false, publicKey=true, runScript=true, blockUntilRunning=true, blockOnComplete=true, port:seconds=-1:-1, metadata/details: false]) Execution failures: 0 error[s] Node failures: 1) UndeclaredThrowableException on node 423208: java.lang.reflect.UndeclaredThrowableException at $Proxy59.getServer(Unknown Source) at org.jclouds.rackspace.cloudservers.compute.strategy.CloudServersGetNodeMetadataStrategy.getNode(CloudServersGetNodeMetadataStrategy.java:51) at org.jclouds.compute.util.ComputeUtils.runOptionsOnNode(ComputeUtils.java:135) at org.jclouds.compute.util.ComputeUtils$1.call(ComputeUtils.java:118) at org.jclouds.compute.util.ComputeUtils$1.call(ComputeUtils.java:114) at org.jclouds.compute.strategy.impl.EncodeTagIntoNameRunNodesAndAddToSetStrategy$1.call(EncodeTagIntoNameRunNodesAndAddToSetStrategy.java:93) at org.jclouds.compute.strategy.impl.EncodeTagIn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.cloudhoist</groupId> | |
<artifactId>cloudhoist</artifactId> | |
<version>0.1.0-SNAPSHOT</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/utils.rb:138:in `union': can't convert Array into String (TypeError) | |
from /Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/utils.rb:138 | |
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' | |
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' | |
from /Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/request.rb:1 | |
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' | |
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' | |
from /Library/Ruby/Gems/1.8/gems/sproutcore-1.4.4/lib/sproutcore/rack/filesystem.rb:10 | |
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' | |
... 6 levels... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns "blah" | |
(:require | |
[pallet.resource :as resource] | |
[pallet.execute :as execute]) | |
(resource/deflocal git-clone | |
"Clone a git repo" | |
(git-clone* | |
[request repo] | |
(execute/local-script ;; in 0.4.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest live-test | |
(doseq [image [{:os-family :ubuntu :os-version-matches "10.04"} | |
{:os-family :ubuntu :os-version-matches "10.10"} | |
{:os-family :centos :os-version-matches "5.5"}]] | |
(live-test/test-nodes | |
[compute node-map node-types] | |
{:java | |
{:image image | |
:count 1 | |
:phases {:bootstrap (resource/phase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest live-test | |
(doseq [image live-test/*images*] | |
(live-test/test-nodes | |
[compute node-map node-types] | |
{:zookeeper | |
{:image image | |
:count 1 | |
:phases {:bootstrap (resource/phase | |
(package/minimal-packages) | |
(package/package-manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pallet.crate | |
"The crate monad. | |
There are two issues with crates as monads. | |
i) need to reimplement crate functions to return functions of one | |
argument [state], so that they have a common signature for manipulation | |
as monadic functions. | |
ii) to achieve pluggable error handling, etc, via monads, requires |