mirror of https://github.com/apache/jclouds.git
moved to jclouds-examples
This commit is contained in:
parent
d4018a5828
commit
27a48fd34f
|
@ -1,29 +0,0 @@
|
|||
====
|
||||
|
||||
Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
||||
|
||||
====================================================================
|
||||
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.
|
||||
====================================================================
|
||||
====
|
||||
|
||||
Note that the following are prerequisites:
|
||||
1. Ant 1.7.1 is installed and in your path
|
||||
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.zip
|
||||
jar -xf apache-ant-1.7.1-bin.zip
|
||||
chmod 755 apache-ant-1.7.1/bin/*
|
||||
export PATH=apache-ant-1.7.1/bin:$PATH
|
||||
2. jsch 0.1.42 is in $ANT_HOME/lib
|
||||
cd apache-ant-1.7.1/lib
|
||||
wget https://sourceforge.net/projects/jsch/files/jsch/jsch-0.1.42.jar
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
provider=bluelock-vcloudirector
|
||||
driver=bluelock
|
||||
identity=user@your_org
|
||||
credential=password
|
||||
tag=name_of_your_vapp
|
|
@ -1,5 +0,0 @@
|
|||
provider=ec2
|
||||
driver=aws
|
||||
identity=accesscredentialid
|
||||
credential=secretaccesscredential
|
||||
tag=we_create_and_delete_based_on_credential_and_security_group_name_not_instance_id
|
|
@ -1,7 +0,0 @@
|
|||
provider=eucalyptus
|
||||
driver=aws
|
||||
# note you need to change this to the correct endpoint
|
||||
eucalyptus.endpoint=http://173.205.188.130:8773/services/Eucalyptus
|
||||
identity=accesskey
|
||||
credential=secret
|
||||
tag=name_of_your_cluster_or_instance
|
|
@ -1,5 +0,0 @@
|
|||
provider=gogrid
|
||||
driver=gogrid
|
||||
identity=apikey
|
||||
credential=secret
|
||||
tag=name_of_your_server
|
|
@ -1,5 +0,0 @@
|
|||
provider=cloudservers
|
||||
driver=rackspace
|
||||
identity=user
|
||||
credential=your_credential
|
||||
tag=name_of_your_server
|
|
@ -1,5 +0,0 @@
|
|||
provider=rimuhosting
|
||||
driver=rimuhosting
|
||||
identity=apicredential
|
||||
credential=apicredential
|
||||
tag=name_of_your_server
|
|
@ -1,5 +0,0 @@
|
|||
provider=trmk-ecloud
|
||||
driver=terremark
|
||||
identity=user@youregistered.com
|
||||
credential=password
|
||||
tag=name_of_your_vapp
|
|
@ -1,5 +0,0 @@
|
|||
provider=trmk-vcloudexpress
|
||||
driver=terremark
|
||||
identity=user@youregistered.com
|
||||
credential=password
|
||||
tag=name_of_your_vapp
|
|
@ -1,7 +0,0 @@
|
|||
provider=vcloud
|
||||
driver=vcloud
|
||||
# note you need to change this to the correct endpoint
|
||||
vcloud.endpoint=https://vcloud_host_you_want/api
|
||||
identity=user@your_org
|
||||
credential=password
|
||||
tag=name_of_your_vapp
|
|
@ -1,126 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
|
||||
Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
||||
|
||||
====================================================================
|
||||
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.
|
||||
====================================================================
|
||||
|
||||
-->
|
||||
|
||||
<project xmlns:artifact="urn:maven-artifact-ant" name="cargooverssh" default="cargooverssh" basedir=".">
|
||||
<property file="build.properties" />
|
||||
<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" />
|
||||
<property name="listenport" value="8080" />
|
||||
<property name="container.zip" value="http://apache.imghat.com//tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.tar.gz" />
|
||||
<property name="warfile" value="build/samples-blazeds.war" />
|
||||
|
||||
<!-- maven must be available before we use it -->
|
||||
<delete dir="build/cargo"/>
|
||||
<mkdir dir="build/cargo"/>
|
||||
|
||||
<get src="http://opensource.become.com/apache//maven/binaries/maven-ant-tasks-2.1.1.jar" dest="build/maven-ant-tasks"/>
|
||||
<get src="http://web-actions.googlecode.com/files/samples-blazeds.war" dest="${warfile}"/>
|
||||
|
||||
<input
|
||||
message="Which provider would you like to use (ec2, cloudservers, vcloud, terremark, rimuhosting)?"
|
||||
validargs="ec2,cloudservers,vcloud,trmk-ecloud,trmk-vcloudexpress,eucalyptus,bluelock-vcdirector,gogrid,rimuhosting"
|
||||
addproperty="provider"
|
||||
/>
|
||||
|
||||
<input
|
||||
message="Which driver does ${provider} use?"
|
||||
validargs="aws,rackspace,vcloud,bluelock,gogrid,terremark,ibmdev,rimuhosting"
|
||||
addproperty="driver"
|
||||
/>
|
||||
|
||||
<!-- initialize maven tasks -->
|
||||
<path id="maven-ant-tasks.classpath" path="build/maven-ant-tasks"/>
|
||||
<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"/>
|
||||
<artifact:remoteRepository id="jclouds.repository" url="http://jclouds.googlecode.com/svn/repo" />
|
||||
<artifact:remoteRepository id="jclouds-snapshot.repository" url="https://oss.sonatype.org/content/repositories/snapshots"/>
|
||||
|
||||
<!-- Setup maven so that we can get latest version of jclouds, jclouds, and jruby -->
|
||||
<artifact:dependencies pathId="jclouds.classpath">
|
||||
<dependency groupid="org.codehaus.cargo" artifactId="cargo-ant" version="1.0.5"/>
|
||||
<dependency groupid="org.codehaus.cargo" artifactId="cargo-core-container-tomcat" version="1.0.5"/>
|
||||
<dependency groupId="org.jclouds" artifactId="jclouds-${driver}" version="${jclouds.version}"/>
|
||||
<dependency groupId="org.jclouds" artifactId="jclouds-antcontrib" version="${jclouds.version}"/>
|
||||
<remoteRepository refid="jclouds.repository"/>
|
||||
<remoteRepository refid="jclouds-snapshot.repository"/>
|
||||
<localRepository refid="local.repository"/>
|
||||
</artifact:dependencies>
|
||||
|
||||
<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" />
|
||||
<taskdef resource="cargo.tasks" classpathref="jclouds.classpath"/>
|
||||
|
||||
<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}"/>
|
||||
|
||||
<target name="destroy" description="destroy the nodes ${tag}">
|
||||
<compute actions="destroy" provider="${url}">
|
||||
<nodes tag="${tag}" />
|
||||
</compute>
|
||||
<sleep seconds="5" />
|
||||
</target>
|
||||
|
||||
<target name="create" description="create the nodes ${tag}" >
|
||||
<compute actions="destroy,create" provider="${url}">
|
||||
<nodes tag="${tag}" os="UBUNTU" hardware="SMALLEST"
|
||||
runscript="runscript.sh" openports="22,${listenport}"
|
||||
privatekeyfile="${privatekeyfile}" publickeyfile="${publickeyfile}"
|
||||
hostproperty="host" usernameproperty="username" />
|
||||
</compute>
|
||||
</target>
|
||||
|
||||
<target name="cargooverssh" depends="create" description="run cargo on remote nodes" >
|
||||
<echo message="deploying tomcat and blaze to: http://${host}:${listenport}/samples-blazeds/" />
|
||||
<cargo containerId="tomcat6x" output="build/output.log" log="build/cargo.log" action="start" timeout="600000">
|
||||
<zipurlinstaller installurl="${container.zip}" />
|
||||
<configuration home="build/cargo" type="standalone">
|
||||
<property name="cargo.java.home" value="/usr/lib/jvm/java-6-openjdk"/>
|
||||
<property name="cargo.hostname" value="${host}"/>
|
||||
<property name="cargo.servlet.port" value="${listenport}"/>
|
||||
<property name="cargo.ssh.host" value="${host}"/>
|
||||
<property name="cargo.ssh.username" value="${username}"/>
|
||||
<property name="cargo.ssh.password" value=""/>
|
||||
<property name="cargo.ssh.keyfile" value="${privatekeyfile}"/>
|
||||
<property name="cargo.ssh.remotebase" value="/tmp/cargo"/>
|
||||
<property name="cargo.logging" value="high"/>
|
||||
<deployable type="war" file="${warfile}"/>
|
||||
</configuration>
|
||||
</cargo>
|
||||
</target>
|
||||
|
||||
<target name="justplaincargo" description="run cargo on local machine" >
|
||||
<echo message="deploying tomcat and blaze to: http://localhost:${listenport}/samples-blazeds/" />
|
||||
<cargo containerId="tomcat6x" output="build/output.log" log="build/cargo.log" action="start" timeout="600000">
|
||||
<zipurlinstaller installurl="${container.zip}" />
|
||||
<configuration home="build/cargo" type="standalone">
|
||||
<property name="cargo.servlet.port" value="${listenport}"/>
|
||||
<property name="cargo.logging" value="high"/>
|
||||
<deployable type="war" file="${warfile}"/>
|
||||
</configuration>
|
||||
</cargo>
|
||||
</target>
|
||||
|
||||
</project>
|
|
@ -1,29 +0,0 @@
|
|||
#
|
||||
#
|
||||
# Copyright (C) 2010 Cloud Conscious, LLC. <info@cloudconscious.com>
|
||||
#
|
||||
# ====================================================================
|
||||
# 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.
|
||||
# ====================================================================
|
||||
#
|
||||
|
||||
echo nameserver 208.67.222.222 >> /etc/resolv.conf
|
||||
apt-get update -qq
|
||||
apt-get upgrade -y -qq
|
||||
apt-get install -y -qq wget
|
||||
apt-get install -y -qq openjdk-6-jdk
|
||||
wget -q http://mirrors.axint.net/apache/tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.tar.gz
|
||||
tar xzf apache-tomcat-6.0.29.tar.gz
|
||||
mkdir -p /tmp/cargo/containers
|
||||
chmod 1777 /tmp/cargo
|
||||
mv apache-tomcat-6.0.29 /tmp/cargo/containers/tomcat6x
|
Loading…
Reference in New Issue