Browse files

Update for 0.4.1 crate versions. Add first shot at a driver function

  • Loading branch information...
1 parent 64b3d01 commit 2801188c43f3480239ce06340b56734a59eb35cd @hugoduncan hugoduncan committed Mar 7, 2011
Showing with 88 additions and 14 deletions.
  1. +53 −9 pom.xml
  2. +18 −0 src/pallet/ci.clj
  3. +17 −5 src/pallet/node/ci.clj
View
62 pom.xml
@@ -22,13 +22,6 @@
</resource>
<resource>
<directory>resources</directory>
- <excludes>
- <exclude>filtered/*</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>resources/filtered</directory>
- <filtering>true</filtering>
</resource>
</resources>
<testResources>
@@ -65,9 +58,43 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>deploy</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <executable>java</executable>
+ <workingDirectory>/tmp</workingDirectory>
+ <!-- <mainClass>clojure.main</mainClass> -->
+ <classpathScope>compile</classpathScope>
+ <arguments>
+ <argument>-e</argument>
+ <argument>(use \'pallet.ci)(converge)</argument>
+ <argument>-Dpallet.ci.node-count=${pallet.ci.node-count}</argument>
+ <classpath/>
+ <argument>clojure.main</argument>
+ </arguments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
</plugins>
</build>
+
<dependencies>
<dependency>
<groupId>org.cloudhoist</groupId>
@@ -124,6 +151,11 @@
<dependency>
<groupId>org.cloudhoist</groupId>
<artifactId>ssh-key</artifactId>
+ <version>0.4.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.cloudhoist</groupId>
+ <artifactId>crontab</artifactId>
<version>0.4.0</version>
</dependency>
@@ -135,6 +167,12 @@
</dependency>
<dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-compute</artifactId>
<version>${jclouds.version}</version>
@@ -192,11 +230,16 @@
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<configuration>
- <clojureOptions>-Dpallet.test.live=true -Dpallet.test.service-name=${pallet.test.service-name} -Dpallet.test.cleanup-nodes=${pallet.test.cleanup-nodes}</clojureOptions>
+ <clojureOptions>-Dpallet.test.live=true -Dpallet.test.service-name=${pallet.test.service-name} -Dpallet.test.cleanup-nodes=${pallet.test.cleanup-nodes} -Dpallet.test.cleanup-nodes=${pallet.test.image-list}</clojureOptions>
</configuration>
</plugin>
</plugins>
</build>
+ <properties>
+ <pallet.test.service-name>live-test</pallet.test.service-name>
+ <pallet.test.cleanup-nodes>true</pallet.test.cleanup-nodes>
+ <pallet.test.image-list/>
+ </properties>
</profile>
</profiles>
@@ -219,7 +262,8 @@
</scm>
<properties>
- <pallet.version>0.4.1</pallet.version>
+ <pallet.version>0.4.8-SNAPSHOT</pallet.version>
<jclouds.version>1.0-beta-8</jclouds.version>
+ <pallet.ci.node-count>1</pallet.ci.node-count>
</properties>
</project>
View
18 src/pallet/ci.clj
@@ -0,0 +1,18 @@
+(ns pallet.ci
+ "Run script"
+ (:require
+ [pallet.core :as core]
+ [pallet.compute :as compute]
+ [pallet.compute.jclouds :as jclouds]
+ [pallet.node.ci :as ci]))
+
+(def node-count-property "pallet.ci.node-count")
+
+(defn converge
+ []
+ (if-let [service (compute/compute-service-from-config-file :ci)]
+ (let [node-count (read-string
+ (or (System/getProperty node-count-property) "1"))]
+ (core/converge {ci/ci node-count} :compute service :phase :configure))
+ (binding [*out* *err*]
+ (println "Could not find :ci service in config.clj"))))
View
22 src/pallet/node/ci.clj
@@ -3,6 +3,7 @@
(:require
[pallet.core :as core]
[pallet.crate.automated-admin-user :as automated-admin-user]
+ [pallet.crate.crontab :as crontab]
[pallet.crate.git :as git]
[pallet.crate.gpg :as gpg]
[pallet.crate.java :as java]
@@ -15,6 +16,7 @@
[pallet.parameter :as parameter]
[pallet.resource :as resource]
[pallet.resource.directory :as directory]
+ [pallet.resource.file :as file]
[pallet.resource.package :as package]
[pallet.resource.remote-file :as remote-file]
[pallet.resource.service :as service]
@@ -80,12 +82,13 @@
:admin-user (properties :hudson.hugo.user)
:admin-password (properties :hudson.hugo.password))
(generate-ssh-keys)
- (hudson/plugin :git)
- (hudson/plugin :github)
- (hudson/plugin :instant-messaging)
- (hudson/plugin :greenballs)
+ (hudson/plugin :git :version "1.1.5")
+ (hudson/plugin :github :version "0.4")
+ (hudson/plugin :instant-messaging :version "1.13")
+ (hudson/plugin :greenballs :version "1.10")
(hudson/plugin
:ircbot
+ :version "2.9"
:enabled true :hostname "irc.freenode.net" :port 6667
:nick "palletci" :nick-serv-password "hudsonci"
:hudson-login (properties :hudson.ircbot.user)
@@ -225,7 +228,16 @@
(iptables/iptables-accept-established)
(ssh/iptables-throttle)
(ssh/iptables-accept)
- (ci-config))
+ (ci-config)
+ (crontab/system-crontab
+ "clj-mvn-tmpfiles"
+ :content (stevedore/script
+ (rm (quoted "/tmp/class*dir")
+ {:force true :recursive true})
+ (rm (quoted "/tmp/pallet*tmp*")
+ {:force true :recursive true})
+ (rm (quoted "/tmp/run-test*.clj") {:force true}))
+ :literal true))
:restart-tomcat (resource/phase
(service/service "tomcat6" :action :restart))
:reload-configuration (resource/phase

0 comments on commit 2801188

Please sign in to comment.