2010-01-11 08:38:07 -05:00
|
|
|
<!--
|
|
|
|
|
|
|
|
|
2010-08-12 19:04:26 -04:00
|
|
|
Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
2010-01-11 08:38: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-02-09 03:23:51 -05:00
|
|
|
<project name="compute" default="dump" basedir="." xmlns:artifact="urn:maven-artifact-ant">
|
2010-01-22 22:22:28 -05:00
|
|
|
<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-15 18:13:35 -05:00
|
|
|
<mkdir dir="build" />
|
2010-02-09 03:23:51 -05:00
|
|
|
|
2010-08-31 14:53:32 -04:00
|
|
|
<get src="http://opensource.become.com/apache//maven/binaries/maven-ant-tasks-2.1.1.jar" dest="build/maven-ant-tasks.jar"/>
|
2010-01-15 18:13:35 -05:00
|
|
|
|
2010-01-22 22:22:28 -05:00
|
|
|
<input
|
2010-08-31 14:53:32 -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 14:53:32 -04:00
|
|
|
addproperty="provider"
|
2010-01-22 22:22:28 -05:00
|
|
|
/>
|
|
|
|
|
|
|
|
<input
|
2010-08-31 14:53:32 -04:00
|
|
|
message="Which driver does ${provider} use?"
|
2010-08-31 17:22:35 -04:00
|
|
|
validargs="aws,rackspace,vcloud,bluelock,gogrid,terremark,ibmdev,rimuhosting"
|
2010-01-22 22:22:28 -05:00
|
|
|
addproperty="driver"
|
|
|
|
/>
|
|
|
|
|
2010-08-31 14:53:32 -04:00
|
|
|
<path id="maven-ant-tasks.classpath" path="build/maven-ant-tasks.jar" />
|
2010-01-15 18:13:35 -05:00
|
|
|
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
|
|
|
|
|
|
|
|
<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-31 14:58:59 -04:00
|
|
|
<artifact:remoteRepository id="jclouds-snapshot.repository" url="https://oss.sonatype.org/content/repositories/snapshots" />
|
2010-01-15 18:13:35 -05:00
|
|
|
|
|
|
|
<artifact:dependencies pathId="jclouds.classpath">
|
2010-02-09 03:23:51 -05:00
|
|
|
<dependency groupId="org.jclouds" artifactId="jclouds-antcontrib" version="${jclouds.version}" />
|
|
|
|
<dependency groupId="org.jclouds" artifactId="jclouds-${driver}" version="${jclouds.version}" />
|
2010-01-15 18:13:35 -05:00
|
|
|
<localRepository refid="local.repository" />
|
2010-02-09 03:23:51 -05:00
|
|
|
<remoteRepository refid="jclouds.repository" />
|
2010-01-15 18:13:35 -05:00
|
|
|
<remoteRepository refid="jclouds-snapshot.repository" />
|
|
|
|
</artifact:dependencies>
|
|
|
|
|
|
|
|
<typedef name="compute" classname="org.jclouds.tools.ant.taskdefs.compute.ComputeTask" classpathref="jclouds.classpath" />
|
|
|
|
|
|
|
|
<input
|
2010-08-31 14:53:32 -04:00
|
|
|
message="What is your identity on ${provider}?"
|
|
|
|
addproperty="identity"
|
2010-01-15 18:13:35 -05:00
|
|
|
/>
|
|
|
|
|
|
|
|
<input
|
2010-08-31 14:53:32 -04:00
|
|
|
message="What is the credential for ${identity}?"
|
|
|
|
addproperty="credential"
|
2010-01-15 18:13:35 -05:00
|
|
|
/>
|
|
|
|
|
2010-08-31 14:53:32 -04:00
|
|
|
<property name="jclouds.compute.url" value="compute://${identity}:${credential}@${provider}" />
|
2010-01-15 18:13:35 -05:00
|
|
|
|
|
|
|
<target name="list" description="list the identity of all nodes">
|
2010-01-28 00:21:11 -05:00
|
|
|
<compute actions="list" provider="${jclouds.compute.url}" />
|
2010-01-15 18:13:35 -05:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="list-details" description="list the details of all nodes">
|
2010-01-28 00:21:11 -05:00
|
|
|
<compute actions="list-details" provider="${jclouds.compute.url}" />
|
2010-01-15 18:13:35 -05:00
|
|
|
</target>
|
|
|
|
|
2010-01-22 16:15:19 -05:00
|
|
|
<target name="list-images" description="list the images supported">
|
2010-01-28 00:21:11 -05:00
|
|
|
<compute actions="list-images" provider="${jclouds.compute.url}" />
|
2010-01-22 16:15:19 -05:00
|
|
|
</target>
|
|
|
|
|
2010-09-11 18:39:27 -04:00
|
|
|
<target name="list-hardwares" description="list the hardwares supported">
|
|
|
|
<compute actions="list-hardwares" provider="${jclouds.compute.url}" />
|
2010-01-22 16:15:19 -05:00
|
|
|
</target>
|
|
|
|
|
2010-01-28 00:21:11 -05:00
|
|
|
<target name="list-locations" description="list the locations supported">
|
|
|
|
<compute actions="list-locations" provider="${jclouds.compute.url}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="dump" description="list all information we can obtain about the cloud">
|
2010-09-11 18:39:27 -04:00
|
|
|
<compute actions="list-locations,list-hardwares,list-images,list-details" provider="${jclouds.compute.url}" />
|
2010-01-28 00:21:11 -05:00
|
|
|
</target>
|
|
|
|
|
2010-06-08 20:11:46 -04:00
|
|
|
<target name="reboot" depends="reboot-id,reboot-tag" />
|
|
|
|
|
|
|
|
<target name="reboot-id" description="reboot the node ${id}" unless="tag">
|
2010-02-09 03:23:51 -05:00
|
|
|
|
|
|
|
<input
|
|
|
|
message="Which node do you wish to reboot"
|
2010-06-08 20:11:46 -04:00
|
|
|
addproperty="id"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<compute actions="reboot" provider="${jclouds.compute.url}">
|
|
|
|
<nodes id="${id}" />
|
|
|
|
</compute>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="reboot-tag" description="reboot the nodes with tag ${tag}" unless="id" >
|
|
|
|
|
|
|
|
<input
|
|
|
|
message="Which tag do you wish to reboot"
|
|
|
|
addproperty="tag"
|
2010-02-09 03:23:51 -05:00
|
|
|
/>
|
|
|
|
|
|
|
|
<compute actions="reboot" provider="${jclouds.compute.url}">
|
2010-06-08 20:11:46 -04:00
|
|
|
<nodes tag="${tag}" />
|
2010-02-09 03:23:51 -05:00
|
|
|
</compute>
|
|
|
|
</target>
|
|
|
|
|
2010-06-08 20:11:46 -04:00
|
|
|
<target name="destroy" depends="destroy-id,destroy-tag" />
|
|
|
|
|
|
|
|
<target name="destroy-id" description="destroy the node ${id}" unless="tag">
|
2010-01-19 21:18:50 -05:00
|
|
|
|
|
|
|
<input
|
|
|
|
message="Which node do you wish to destroy"
|
2010-06-08 20:11:46 -04:00
|
|
|
addproperty="id"
|
2010-01-19 21:18:50 -05:00
|
|
|
/>
|
|
|
|
|
2010-01-28 00:21:11 -05:00
|
|
|
<compute actions="destroy" provider="${jclouds.compute.url}">
|
2010-06-08 20:11:46 -04:00
|
|
|
<nodes id="${id}" />
|
|
|
|
</compute>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="destroy-tag" description="destroy the nodes with tag ${tag}" unless="id" >
|
|
|
|
|
|
|
|
<input
|
|
|
|
message="Which tag do you wish to destroy"
|
|
|
|
addproperty="tag"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<compute actions="destroy" provider="${jclouds.compute.url}">
|
|
|
|
<nodes tag="${tag}" />
|
|
|
|
</compute>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="get" depends="get-tag,get-id" />
|
|
|
|
|
|
|
|
<target name="get-id" description="get the node ${id}" unless="tag">
|
|
|
|
|
|
|
|
<input
|
|
|
|
message="Which node do you wish to get"
|
|
|
|
addproperty="id"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<compute actions="get" provider="${jclouds.compute.url}">
|
|
|
|
<nodes id="${id}" />
|
2010-01-15 18:13:35 -05:00
|
|
|
</compute>
|
|
|
|
</target>
|
|
|
|
|
2010-06-08 20:11:46 -04:00
|
|
|
<target name="get-tag" description="get the nodes with tag ${tag}" unless="id" >
|
2010-01-19 21:18:50 -05:00
|
|
|
|
|
|
|
<input
|
2010-06-08 20:11:46 -04:00
|
|
|
message="Which tag do you wish to get"
|
|
|
|
addproperty="tag"
|
2010-01-19 21:18:50 -05:00
|
|
|
/>
|
|
|
|
|
2010-01-28 00:21:11 -05:00
|
|
|
<compute actions="get" provider="${jclouds.compute.url}">
|
2010-06-08 20:11:46 -04:00
|
|
|
<nodes tag="${tag}" />
|
2010-01-15 18:13:35 -05:00
|
|
|
</compute>
|
|
|
|
</target>
|
|
|
|
|
2010-01-22 04:35:39 -05:00
|
|
|
<property name="location" value="" />
|
2010-06-08 20:11:46 -04:00
|
|
|
<target name="create" description="create the node ${tag}">
|
2010-02-02 03:31:30 -05:00
|
|
|
<property name="privatekeyfile" value="${user.home}/.ssh/id_rsa" />
|
|
|
|
<property name="publickeyfile" value="${user.home}/.ssh/id_rsa.pub" />
|
2010-01-20 06:34:24 -05:00
|
|
|
<property name="os" value="UBUNTU" />
|
2010-02-02 03:31:30 -05:00
|
|
|
<property name="count" value="1" />
|
2010-01-19 21:18:50 -05:00
|
|
|
|
|
|
|
<input
|
2010-01-28 04:02:37 -05:00
|
|
|
message="What do you want to tag your nodes with?"
|
2010-06-08 20:11:46 -04:00
|
|
|
addproperty="tag"
|
2010-01-19 21:18:50 -05:00
|
|
|
/>
|
|
|
|
|
2010-01-28 00:21:11 -05:00
|
|
|
<compute actions="create" provider="${jclouds.compute.url}">
|
2010-09-11 18:39:27 -04:00
|
|
|
<nodes privatekeyfile="${privatekeyfile}" publickeyfile="${publickeyfile}" tag="${tag}" count="${count}" os="${os}" hardware="SMALLEST" hostproperty="host" usernameproperty="username" passwordproperty="password" />
|
2010-01-15 18:13:35 -05:00
|
|
|
</compute>
|
|
|
|
</target>
|
2010-01-11 08:38:07 -05:00
|
|
|
|
|
|
|
</project>
|