2010-01-11 00:57:07 -05:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!--
|
|
|
|
|
2010-08-12 19:04:26 -04:00
|
|
|
|
|
|
|
Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
2010-01-11 00:57:07 -05:00
|
|
|
|
|
|
|
====================================================================
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
====================================================================
|
|
|
|
|
|
|
|
-->
|
2010-08-12 19:04:26 -04:00
|
|
|
|
2010-01-11 00:57:07 -05:00
|
|
|
<project xmlns:artifact="urn:maven-artifact-ant" name="cargooverssh" default="cargooverssh" basedir=".">
|
|
|
|
<property file="build.properties" />
|
2010-02-09 03:23:51 -05:00
|
|
|
<property name="jclouds.version" value="1.0-SNAPSHOT" />
|
|
|
|
<property name="privatekeyfile" value="${user.home}/.ssh/id_rsa" />
|
|
|
|
<property name="publickeyfile" value="${user.home}/.ssh/id_rsa.pub" />
|
2010-01-21 01:22:42 -05:00
|
|
|
<property name="listenport" value="8080" />
|
2010-08-31 17:22:35 -04:00
|
|
|
<property name="container.zip" value="http://apache.imghat.com//tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.tar.gz" />
|
2010-01-11 13:01:30 -05:00
|
|
|
<property name="warfile" value="build/samples-blazeds.war" />
|
2010-01-11 00:57:07 -05:00
|
|
|
|
|
|
|
<!-- maven must be available before we use it -->
|
|
|
|
<delete dir="build/cargo"/>
|
|
|
|
<mkdir dir="build/cargo"/>
|
|
|
|
|
2010-08-31 17:22:35 -04:00
|
|
|
<get src="http://opensource.become.com/apache//maven/binaries/maven-ant-tasks-2.1.1.jar" dest="build/maven-ant-tasks"/>
|
2010-01-11 13:01:30 -05:00
|
|
|
<get src="http://web-actions.googlecode.com/files/samples-blazeds.war" dest="${warfile}"/>
|
2010-02-09 03:23:51 -05:00
|
|
|
|
2010-01-22 22:22:28 -05:00
|
|
|
<input
|
2010-08-31 17:22:35 -04:00
|
|
|
message="Which provider would you like to use (ec2, cloudservers, vcloud, terremark, rimuhosting)?"
|
2010-09-19 16:30:11 -04:00
|
|
|
validargs="ec2,cloudservers,vcloud,trmk-ecloud,trmk-vcloudexpress,eucalyptus,bluelock-vcdirector,gogrid,rimuhosting"
|
2010-08-31 17:22:35 -04:00
|
|
|
addproperty="provider"
|
2010-01-22 22:22:28 -05:00
|
|
|
/>
|
|
|
|
|
|
|
|
<input
|
2010-08-31 17:22:35 -04:00
|
|
|
message="Which driver does ${provider} use?"
|
|
|
|
validargs="aws,rackspace,vcloud,bluelock,gogrid,terremark,ibmdev,rimuhosting"
|
2010-01-22 22:22:28 -05:00
|
|
|
addproperty="driver"
|
|
|
|
/>
|
|
|
|
|
2010-01-11 00:57:07 -05:00
|
|
|
<!-- initialize maven tasks -->
|
2010-08-31 17:22:35 -04:00
|
|
|
<path id="maven-ant-tasks.classpath" path="build/maven-ant-tasks"/>
|
2010-01-11 00:57:07 -05:00
|
|
|
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath"/>
|
2010-01-11 08:38:07 -05:00
|
|
|
|
2010-01-11 00:57:07 -05:00
|
|
|
<artifact:localRepository id="local.repository" path="${user.home}/.m2/repository"/>
|
2010-02-09 03:23:51 -05:00
|
|
|
<artifact:remoteRepository id="jclouds.repository" url="http://jclouds.googlecode.com/svn/repo" />
|
2010-08-27 20:26:49 -04:00
|
|
|
<artifact:remoteRepository id="jclouds-snapshot.repository" url="https://oss.sonatype.org/content/repositories/snapshots"/>
|
2010-01-11 08:38:07 -05:00
|
|
|
|
2010-01-11 00:57:07 -05:00
|
|
|
<!-- Setup maven so that we can get latest version of jclouds, jclouds, and jruby -->
|
|
|
|
<artifact:dependencies pathId="jclouds.classpath">
|
2010-08-31 17:22:35 -04:00
|
|
|
<dependency groupid="org.codehaus.cargo" artifactId="cargo-ant" version="1.0.3"/>
|
|
|
|
<dependency groupid="org.codehaus.cargo" artifactId="cargo-core-container-tomcat" version="1.0.3"/>
|
2010-02-09 03:23:51 -05:00
|
|
|
<dependency groupId="org.jclouds" artifactId="jclouds-${driver}" version="${jclouds.version}"/>
|
|
|
|
<dependency groupId="org.jclouds" artifactId="jclouds-antcontrib" version="${jclouds.version}"/>
|
|
|
|
<remoteRepository refid="jclouds.repository"/>
|
2010-01-11 00:57:07 -05:00
|
|
|
<remoteRepository refid="jclouds-snapshot.repository"/>
|
|
|
|
<localRepository refid="local.repository"/>
|
|
|
|
</artifact:dependencies>
|
2010-01-11 08:38:07 -05:00
|
|
|
|
|
|
|
<typedef name="compute" classname="org.jclouds.tools.ant.taskdefs.compute.ComputeTask" classpathref="jclouds.classpath" />
|
|
|
|
<taskdef name="sshexec" classname="org.apache.tools.ant.taskdefs.optional.ssh.SSHExec" classpathref="jclouds.classpath" />
|
2010-01-11 00:57:07 -05:00
|
|
|
<taskdef resource="cargo.tasks" classpathref="jclouds.classpath"/>
|
|
|
|
|
2010-08-31 17:22:35 -04:00
|
|
|
<input message="What is your identity on ${provider}?" addproperty="identity"/>
|
|
|
|
<input message="What is the credential for ${identity}?" addproperty="credential"/>
|
|
|
|
<input message="What is the tag for the deployment?" addproperty="tag"/>
|
|
|
|
<property name="url" value="compute://${identity}:${credential}@${provider}"/>
|
2010-01-11 00:57:07 -05:00
|
|
|
|
2010-08-31 17:22:35 -04:00
|
|
|
<target name="destroy" description="destroy the nodes ${tag}">
|
2010-01-28 00:21:11 -05:00
|
|
|
<compute actions="destroy" provider="${url}">
|
2010-08-31 17:22:35 -04:00
|
|
|
<nodes tag="${tag}" />
|
2010-01-11 08:38:07 -05:00
|
|
|
</compute>
|
2010-01-22 16:35:45 -05:00
|
|
|
<sleep seconds="5" />
|
2010-01-11 08:38:07 -05:00
|
|
|
</target>
|
|
|
|
|
2010-08-31 17:22:35 -04:00
|
|
|
<target name="create" description="create the nodes ${tag}" >
|
2010-01-28 00:21:11 -05:00
|
|
|
<compute actions="destroy,create" provider="${url}">
|
2010-08-31 17:22:35 -04:00
|
|
|
<nodes tag="${tag}" os="UBUNTU" size="SMALLEST"
|
2010-01-21 01:22:42 -05:00
|
|
|
runscript="runscript.sh" openports="22,${listenport}"
|
2010-02-09 03:23:51 -05:00
|
|
|
privatekeyfile="${privatekeyfile}" publickeyfile="${publickeyfile}"
|
|
|
|
hostproperty="host" usernameproperty="username" />
|
2010-01-11 08:38:07 -05:00
|
|
|
</compute>
|
2010-01-11 00:57:07 -05:00
|
|
|
</target>
|
|
|
|
|
2010-01-28 00:21:11 -05:00
|
|
|
<target name="cargooverssh" depends="create" description="run cargo on remote nodes" >
|
2010-02-09 03:23:51 -05:00
|
|
|
<echo message="deploying tomcat and blaze to: http://${host}:${listenport}/samples-blazeds/" />
|
2010-01-11 08:38:07 -05:00
|
|
|
<cargo containerId="tomcat6x" output="build/output.log" log="build/cargo.log" action="start" timeout="600000">
|
2010-01-18 17:56:58 -05:00
|
|
|
<zipurlinstaller installurl="${container.zip}" />
|
2010-01-11 00:57:07 -05:00
|
|
|
<configuration home="build/cargo" type="standalone">
|
2010-01-11 08:38:07 -05:00
|
|
|
<property name="cargo.java.home" value="/usr/lib/jvm/java-6-openjdk"/>
|
|
|
|
<property name="cargo.hostname" value="${host}"/>
|
2010-01-21 01:22:42 -05:00
|
|
|
<property name="cargo.servlet.port" value="${listenport}"/>
|
2010-01-11 08:38:07 -05:00
|
|
|
<property name="cargo.ssh.host" value="${host}"/>
|
|
|
|
<property name="cargo.ssh.username" value="${username}"/>
|
2010-02-09 03:23:51 -05:00
|
|
|
<property name="cargo.ssh.password" value=""/>
|
|
|
|
<property name="cargo.ssh.keyfile" value="${privatekeyfile}"/>
|
2010-01-11 08:38:07 -05:00
|
|
|
<property name="cargo.ssh.remotebase" value="/tmp/cargo"/>
|
2010-01-11 00:57:07 -05:00
|
|
|
<property name="cargo.logging" value="high"/>
|
2010-01-11 13:01:30 -05:00
|
|
|
<deployable type="war" file="${warfile}"/>
|
|
|
|
</configuration>
|
|
|
|
</cargo>
|
|
|
|
</target>
|
|
|
|
|
2010-01-15 18:13:35 -05:00
|
|
|
<target name="justplaincargo" description="run cargo on local machine" >
|
2010-02-09 03:23:51 -05:00
|
|
|
<echo message="deploying tomcat and blaze to: http://localhost:${listenport}/samples-blazeds/" />
|
2010-01-11 13:01:30 -05:00
|
|
|
<cargo containerId="tomcat6x" output="build/output.log" log="build/cargo.log" action="start" timeout="600000">
|
2010-01-18 17:56:58 -05:00
|
|
|
<zipurlinstaller installurl="${container.zip}" />
|
2010-01-11 13:01:30 -05:00
|
|
|
<configuration home="build/cargo" type="standalone">
|
2010-01-21 01:22:42 -05:00
|
|
|
<property name="cargo.servlet.port" value="${listenport}"/>
|
2010-01-11 13:01:30 -05:00
|
|
|
<property name="cargo.logging" value="high"/>
|
|
|
|
<deployable type="war" file="${warfile}"/>
|
2010-01-11 00:57:07 -05:00
|
|
|
</configuration>
|
|
|
|
</cargo>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|