mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Remove the last remnants of the old build system
This commit is contained in:
parent
1d67c80580
commit
e138596aa7
49
build.xml
49
build.xml
@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you 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 name="Cloud Stack Build Dispatch" default="help" basedir=".">
|
||||
<description>
|
||||
This is the overall dispatch file. It includes other build
|
||||
files but doesnot provide targets of its own. Do not modify
|
||||
this file. If you need to create your own targets, modify the
|
||||
developer.xml.
|
||||
</description>
|
||||
|
||||
<dirname property="base.dir" file="${ant.file.Cloud Stack Build Dispatch}"/>
|
||||
|
||||
<condition property="build-cloud.properties.file" value="${base.dir}/build/override/build-cloud.properties" else="${base.dir}/build/build-cloud.properties">
|
||||
<available file="${base.dir}/build/override/build-cloud.properties" />
|
||||
</condition>
|
||||
|
||||
<property file="${build-cloud.properties.file}"/>
|
||||
|
||||
<property name="dist.dir" location="${base.dir}/dist"/>
|
||||
<property name="target.dir" location="${base.dir}/target"/>
|
||||
|
||||
<import file="${base.dir}/build/build-cloud.xml" optional="false"/>
|
||||
<import file="${base.dir}/build/build-cloud-plugins.xml" optional="false"/>
|
||||
<import file="${base.dir}/build/build-docs.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/build-tests.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/build-marvin.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/package.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/developer.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/build-devcloud.xml" optional="true"/>
|
||||
<import file="${base.dir}/build/build-usage.xml" optional="false"/>
|
||||
<import file="${base.dir}/build/build-aws-api.xml" optional="false"/>
|
||||
</project>
|
||||
18
build/.gitignore
vendored
18
build/.gitignore
vendored
@ -1,18 +0,0 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
|
||||
/override
|
||||
@ -1,28 +0,0 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
|
||||
company.major.version=1
|
||||
company.minor.version=0
|
||||
company.patch.version=8
|
||||
|
||||
target.compat.version=1.6
|
||||
source.compat.version=1.6
|
||||
|
||||
debug=true
|
||||
build.type=developer
|
||||
debuglevel=lines,source,vars
|
||||
deprecation=off
|
||||
@ -1,478 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="awsapi" default="help" basedir=".">
|
||||
<target name="help">
|
||||
<echo level="info" message="Ant Build File for awsapi" />
|
||||
<echo level="info" message="Type 'ant -projecthelp' to get a list of targets and their descriptions." />
|
||||
</target>
|
||||
<target name="usage" depends="help" />
|
||||
<dirname property="base.dir" file="${ant.file.awsapi}/.." />
|
||||
<property environment="env" />
|
||||
<property name="axis2.home" value="${base.dir}" />
|
||||
<path id="axis2.classpath">
|
||||
<fileset dir="${axis2.home}">
|
||||
<include name="deps/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
<taskdef name="wsdl2code" classname="org.apache.axis2.tool.ant.AntCodegenTask" classpathref="axis2.classpath" />
|
||||
<!-- directories for build and distribution -->
|
||||
<!-- property name="env.CATALINA_HOME" value="${base.dir}/tomcat" / -->
|
||||
<property name="catalina.dir" value="${env.CATALINA_HOME}" />
|
||||
<property name="build.dir" location="${base.dir}/build" />
|
||||
<property name="buildnumber.dir" location="${build.dir}/" />
|
||||
<property name="target.dir" location="${base.dir}/target" />
|
||||
<property name="classes.dir" location="${target.dir}/classes" />
|
||||
<property name="dist.files.dir" location="${target.dir}/dist-files" />
|
||||
<property name="db.dir" location="${base.dir}/awsapi-setup/db/mysql" />
|
||||
<property name="jar.dir" location="${target.dir}/jar" />
|
||||
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
|
||||
<property name="thirdparty.dir" location="${base.dir}/deps/awsapi-lib" />
|
||||
<!-- <property name="rampart.dir" location="${base.dir}/deps/awsapi-lib/rampart-lib" /> -->
|
||||
<property file="${build.dir}/build-aws-api.properties" />
|
||||
<property name="version" value="${company.major.version}.${company.minor.version}.${company.patch.version}" />
|
||||
<property name="tomcat.home" location="${catalina.dir}" />
|
||||
<property name="deploy.dir" location="${tomcat.home}" />
|
||||
<property name="rpm.tomcat.dir" location="${rpm.install.dir}/usr/share/cloud/bridge" />
|
||||
<property name="debian.install.dir" location="${base.dir}/packages/config/debian/tmp" />
|
||||
<property name="debian.tomcat.dir" location="${debian.install.dir}/usr/share/cloud/bridge" />
|
||||
<echo level="info" message="deploy home: ${deploy.dir}" />
|
||||
<path id="thirdparty.classpath">
|
||||
<fileset dir="${thirdparty.dir}">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
<!-- <path id="rampart.classpath">
|
||||
<fileset dir="${rampart.dir}">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</path> -->
|
||||
<path id="dist.classpath">
|
||||
<fileset dir="${target.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
<target name="-init-awsapi">
|
||||
<mkdir dir="${dist.files.dir}" />
|
||||
<record name="${build.log}" loglevel="verbose" action="start" />
|
||||
<!-- create a UTC build timestamp using ISO 8601 formatting -->
|
||||
<tstamp>
|
||||
<format property="utc.build.timestamp" pattern="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" timezone="GMT" />
|
||||
</tstamp>
|
||||
<!-- remember who/where did the build -->
|
||||
<exec executable="hostname" outputproperty="host.name" />
|
||||
<property name="builder.at" value="${user.name} at ${host.name}" />
|
||||
<property name="builder.id" value="${builder.at}, on ${utc.build.timestamp}" />
|
||||
<property name="built.by" value="${builder.at}, ${utc.build.timestamp}" />
|
||||
<echo level="info" message="builder: ${builder.id}" />
|
||||
<!-- set build.number property, stored in eponymous file -->
|
||||
<buildnumber file="${buildnumber.dir}/build.number" />
|
||||
<condition property="impl.version" value="${version}.${build.number}" else="${version}">
|
||||
<and>
|
||||
<isset property="update.build.number" />
|
||||
</and>
|
||||
</condition>
|
||||
<echo message="Build number is ${impl.version}" />
|
||||
<!--
|
||||
<propertyfile file="${base.dir}/awsapi/conf/ec2-service.properties">
|
||||
<entry key="awsapiVersion" value="${impl.version}" />
|
||||
</propertyfile>
|
||||
-->
|
||||
<!-- Create the build directory structure used by compile -->
|
||||
<mkdir dir="${jar.dir}" />
|
||||
<mkdir dir="${dep.cache.dir}" />
|
||||
<record name="${build.log}" action="stop" />
|
||||
</target>
|
||||
|
||||
<target name="clean-awsapi" description="clean up files generated by the build">
|
||||
<delete file="${build.log}" />
|
||||
<delete dir="${classes.dir}" />
|
||||
<delete dir="${jar.dir}" />
|
||||
<delete dir="${dist.files.dir}" />
|
||||
<delete dir="${target.dir}" />
|
||||
</target>
|
||||
<target name="clean-awsapi-tomcat">
|
||||
<delete dir="${tomcat.home}/webapps/awsapi" />
|
||||
<delete dir="${tomcat.home}/webapps7080/awsapi" />
|
||||
</target>
|
||||
<path id="awsapi.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<!-- <path refid="thirdparty.classpath" /> -->
|
||||
<!-- <path refid="rampart.classpath" /> -->
|
||||
<path refid="dist.classpath" />
|
||||
</path>
|
||||
<target name="compile-awsapi" depends="-init-awsapi" description="Compile Cloud.com Simple Storage Service">
|
||||
<compile-java jar.name="cloud-awsapi.jar" top.dir="${base.dir}/awsapi" classpath="awsapi.classpath">
|
||||
<include-files>
|
||||
<fileset dir="${base.dir}/awsapi/src">
|
||||
<include name="**/*.hbm.xml" />
|
||||
</fileset>
|
||||
</include-files>
|
||||
</compile-java>
|
||||
</target>
|
||||
<target name="build-awsapi-jar" depends="-init-awsapi, compile-awsapi" description="Builds awsapi jar file.">
|
||||
<jar jarfile="${dist.files.dir}/cloud-awsapi.jar" basedir="${target.dir}/classes/cloud-awsapi.jar" excludes="**/client/*">
|
||||
<fileset dir="${base.dir}/awsapi/src">
|
||||
<include name="**/*.hbm.xml" />
|
||||
</fileset>
|
||||
</jar>
|
||||
</target>
|
||||
<target name="build-awsapi-s3" depends="-init-awsapi, compile-awsapi" description="Builds awsapi S3 AAR file.">
|
||||
<jar jarfile="${dist.files.dir}/cloud-s3.aar" basedir="${target.dir}/classes/cloud-awsapi.jar" excludes="**/*">
|
||||
<!--
|
||||
<metainf dir="${base.dir}/resource/AmazonS3">
|
||||
<include name="services.xml" />
|
||||
<include name="AmazonS3.wsdl" />
|
||||
</metainf>
|
||||
-->
|
||||
</jar>
|
||||
</target>
|
||||
<target name="build-cloud-auth-s3" depends="-init-awsapi, compile-awsapi" description="Builds awsapi S3 auth MAR file.">
|
||||
<jar jarfile="${dist.files.dir}/cloud-auth-s3.mar" basedir="${target.dir}/classes/cloud-awsapi.jar" excludes="**/*">
|
||||
<fileset dir="${target.dir}/classes/cloud-awsapi.jar">
|
||||
<include name="**/auth/s3/*.class" />
|
||||
</fileset>
|
||||
<metainf dir="${base.dir}/awsapi/src/com/cloud/bridge/auth/s3">
|
||||
<include name="module.xml" />
|
||||
</metainf>
|
||||
</jar>
|
||||
</target>
|
||||
<target name="build-awsapi-ec2" depends="-init-awsapi, compile-awsapi" description="Builds awsapi EC2 AAR file.">
|
||||
<jar jarfile="${dist.files.dir}/cloud-ec2.aar" basedir="${target.dir}/classes/cloud-awsapi.jar" excludes="**/*">
|
||||
<metainf dir="${base.dir}/awsapi/resource/AmazonEC2">
|
||||
<include name="services.xml" />
|
||||
</metainf>
|
||||
</jar>
|
||||
</target>
|
||||
<target name="build-cloud-auth-ec2" depends="-init-awsapi, compile-awsapi" description="Builds awsapi EC2 auth MAR file.">
|
||||
<jar jarfile="${dist.files.dir}/cloud-auth-ec2.mar" basedir="${target.dir}/classes/cloud-awsapi.jar" excludes="**/*">
|
||||
<fileset dir="${target.dir}/classes/cloud-awsapi.jar">
|
||||
<include name="**/auth/ec2/*.class" />
|
||||
</fileset>
|
||||
<metainf dir="${base.dir}/awsapi/src/com/cloud/bridge/auth/ec2">
|
||||
<include name="module.xml" />
|
||||
</metainf>
|
||||
</jar>
|
||||
</target>
|
||||
<target name="deploy-axis" depends="-init-awsapi">
|
||||
<unwar overwrite="true" src="${base.dir}/deps/awsapi-lib/axis2-webapp-1.5.1.war" dest="${server.deploy.to.dir}/webapps7080/awsapi" >
|
||||
<patternset>
|
||||
<exclude name="WEB-INF/lib/log4j-1.2.15.jar"/>
|
||||
</patternset>
|
||||
</unwar>
|
||||
</target>
|
||||
<condition property="access_key.private.notpresent">
|
||||
<not>
|
||||
<available file="${base.dir}/awsapi/cloud_private_key.pem" type="file" property="access_key.private.notpresent"/>
|
||||
</not>
|
||||
</condition>
|
||||
<!-- Dev Environment ONLY -->
|
||||
<target name="generate-cloud-access-keys" if="access_key.private.notpresent">
|
||||
<exec executable="openssl" searchpath="true">
|
||||
<arg line="req -x509 -nodes -days 365 -newkey rsa:2048 -subj '/C=US/ST=California/L=Cupertino/O=cloud.com/CN=awsapi-test' -keyout ${base.dir}/cloud_private_key.pem -out ${base.dir}/cloud_cert.pem"/>
|
||||
</exec>
|
||||
</target>
|
||||
<!-- Dev Environment ONLY - this assumes EC2_ACCESS_KEY, EC2_SECRET_KEY and EC2_URL have already been defined...-->
|
||||
<target name="register-cloud-bridge" description="Register with cloud-bridge (For Dev environments only)" depends="generate-cloud-access-keys">
|
||||
<exec executable="${base.dir}/awsapi-setup/setup/cloud-bridge-register">
|
||||
<arg value="--apikey=${env.EC2_ACCESS_KEY}" />
|
||||
<arg value="--secretkey=${env.EC2_SECRET_KEY}" />
|
||||
<arg value="--cert=${base.dir}/cloud_cert.pem" />
|
||||
<arg value="--url=${env.EC2_URL}" />
|
||||
</exec>
|
||||
</target>
|
||||
<target name="build-awsapi" depends="build-awsapi-jar,build-awsapi-s3,build-awsapi-ec2,build-cloud-auth-s3,build-cloud-auth-ec2" description="Builds all of awsapi">
|
||||
</target>
|
||||
<target name="deploy-awsapi" depends="deploy-axis">
|
||||
<!--
|
||||
<copy todir="${deploy.dir}/webapps7080/awsapi/WEB-INF/services">
|
||||
<fileset dir="${dist.files.dir}">
|
||||
<include name="cloud-s3.aar"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
-->
|
||||
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/services">
|
||||
<fileset dir="${dist.files.dir}">
|
||||
<include name="cloud-ec2.aar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/modules">
|
||||
<fileset dir="${dist.files.dir}">
|
||||
<include name="cloud-auth-s3.mar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/modules">
|
||||
<fileset dir="${dist.files.dir}">
|
||||
<include name="cloud-auth-ec2.mar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/lib">
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="cloud-awsapi.jar" />
|
||||
<include name="jasypt-1.9.0.jar" />
|
||||
<include name="cloud-utils.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/lib">
|
||||
<fileset dir="${base.dir}/deps/awsapi-lib">
|
||||
<include name="*.jar" />
|
||||
<exclude name="mysql-connector-java-5.1.7-bin.jar" />
|
||||
<exclude name="servlet-api.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${server.deploy.to.dir}/lib">
|
||||
<fileset dir="${base.dir}/deps/awsapi-lib">
|
||||
<include name="mysql-connector-java-5.1.7-bin.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="false" todir="${server.deploy.to.dir}/conf">
|
||||
<fileset dir="${base.dir}/awsapi/conf/">
|
||||
<include name="**/*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/conf">
|
||||
<fileset dir="${base.dir}/awsapi/resource/Axis2/">
|
||||
<include name="axis2.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF">
|
||||
<fileset dir="${base.dir}/awsapi/web/">
|
||||
<include name="web.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<!-- rampart lib goes where the axis lib files go
|
||||
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/lib">
|
||||
<fileset dir="${base.dir}/deps/awsapi-lib/rampart-lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</copy> -->
|
||||
<!-- copying over rampart mar files for WS-Security -->
|
||||
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/modules">
|
||||
<fileset dir="${base.dir}/deps/awsapi-lib/modules">
|
||||
<include name="*.mar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<!-- WS-Security requires this keystore -->
|
||||
<copy todir="${server.deploy.to.dir}/webapps7080/awsapi/WEB-INF/classes">
|
||||
<fileset dir="${base.dir}/awsapi/resource/AmazonEC2">
|
||||
<include name="crypto.properties" />
|
||||
<include name="xes.keystore" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
<!--
|
||||
<target name="deploy-debian-install" depends="build-awsapi-jar, build-awsapi">
|
||||
<copy todir="${debian.tomcat.dir}/webapps7080/awsapi/WEB-INF/services">
|
||||
<fileset dir="${dist.files.dir}">
|
||||
<include name="cloud-s3.aar"/>
|
||||
<include name="cloud-ec2.aar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${debian.tomcat.dir}/webapps7080/awsapi/WEB-INF/modules">
|
||||
<fileset dir="${dist.files.dir}">
|
||||
<include name="cloud-auth-s3.mar" />
|
||||
<include name="cloud-auth-ec2.mar" />
|
||||
</fileset>
|
||||
<fileset dir="${base.dir}/modules">
|
||||
<include name="*.mar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${debian.tomcat.dir}/webapps7080/awsapi/WEB-INF/lib">
|
||||
<fileset dir="${base.dir}/rampart-lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="cloud-awsapi.jar" />
|
||||
<include name="jasypt-1.9.0.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${debian.tomcat.dir}/lib">
|
||||
<fileset dir="${base.dir}/lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${debian.tomcat.dir}/webapps7080/awsapi/WEB-INF/classes">
|
||||
<fileset dir="${base.dir}/resource/AmazonEC2">
|
||||
<include name="crypto.properties" />
|
||||
<include name="xes.keystore" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${debian.tomcat.dir}/conf">
|
||||
<fileset dir="${base.dir}/awsapi/conf/">
|
||||
<include name="**/*" />
|
||||
</fileset>
|
||||
<fileset dir="${base.dir}/awsapi-setup/tomcat">
|
||||
<include name="**/*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${debian.tomcat.dir}/webapps7080/awsapi/WEB-INF/conf">
|
||||
<fileset dir="${base.dir}/awsapi/resource/Axis2/">
|
||||
<include name="axis2.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${debian.tomcat.dir}/webapps7080/awsapi/WEB-INF">
|
||||
<fileset dir="${base.dir}/awsapi/web/">
|
||||
<include name="web.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${debian.install.dir}/usr/share/cloud/setup/bridge/db">
|
||||
<fileset dir="${base.dir}/db/mysql">
|
||||
<include name="*.sql" />
|
||||
<include name="*.sh" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${debian.install.dir}/etc/init.d">
|
||||
<fileset dir="${base.dir}/awsapi-setup/init/debian/">
|
||||
<include name="cloud-bridge" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${debian.install.dir}/usr/bin">
|
||||
<fileset dir="${base.dir}/awsapi-setup/setup">
|
||||
<include name="*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
-->
|
||||
|
||||
<target name="deploy-rpm-install" depends="build-awsapi-jar, build-awsapi">
|
||||
<copy todir="${rpm.tomcat.dir}/webapps7080/awsapi/WEB-INF/services">
|
||||
<fileset dir="${dist.files.dir}">
|
||||
<!--
|
||||
<include name="cloud-s3.aar"/>
|
||||
-->
|
||||
<include name="cloud-ec2.aar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${rpm.tomcat.dir}/webapps7080/awsapi/WEB-INF/modules">
|
||||
<fileset dir="${dist.files.dir}">
|
||||
<include name="cloud-auth-s3.mar" />
|
||||
<include name="cloud-auth-ec2.mar" />
|
||||
</fileset>
|
||||
<fileset dir="${base.dir}/awsapi/modules">
|
||||
<include name="*.mar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${rpm.tomcat.dir}/webapps7080/awsapi/WEB-INF/lib">
|
||||
<fileset dir="${base.dir}/deps/awsapi-lib/rampart-lib">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${base.dir}/deps">
|
||||
<include name="axiom-*.jar"/>
|
||||
<include name="jasypt-1.9.0.jar"/>
|
||||
<include name="jasypt-1.9.0.jar"/>
|
||||
<include name="axis2-*.jar"/>
|
||||
<include name="XmlSchema-*.jar"/>
|
||||
<include name="json-simple*.jar"/>
|
||||
<include name="neethi*.jar"/>
|
||||
<include name="woden-*.jar"/>
|
||||
<include name="xercesImpl*.jar"/>
|
||||
<include name="xml-apis*.jar"/>
|
||||
<include name="antlr*.jar"/>
|
||||
<include name="dom4j*.jar"/>
|
||||
<include name="javassist*.jar"/>
|
||||
</fileset>
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="cloud-awsapi.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${rpm.tomcat.dir}/lib">
|
||||
<fileset dir="${base.dir}/deps/awsapi-lib/">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${rpm.tomcat.dir}/webapps7080/awsapi/WEB-INF/classes">
|
||||
<fileset dir="${base.dir}/awsapi/resource/AmazonEC2">
|
||||
<include name="crypto.properties" />
|
||||
<include name="xes.keystore" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="false" todir="${rpm.tomcat.dir}/conf">
|
||||
<fileset dir="${base.dir}/awsapi/conf/">
|
||||
<include name="**/*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${rpm.tomcat.dir}/webapps7080/awsapi/WEB-INF/conf">
|
||||
<fileset dir="${base.dir}/awsapi/resource/Axis2/">
|
||||
<include name="axis2.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${rpm.tomcat.dir}/webapps7080/awsapi/WEB-INF">
|
||||
<fileset dir="${base.dir}/awsapi/web/">
|
||||
<include name="web.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${rpm.install.dir}/usr/share/cloud/setup/bridge/db">
|
||||
<fileset dir="${base.dir}/awsapi-setup/db/mysql">
|
||||
<include name="*.sql" />
|
||||
<include name="*.sh" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${rpm.install.dir}/etc/init.d">
|
||||
<fileset dir="${base.dir}/awsapi-setup/init/rpm/">
|
||||
<include name="cloud-bridge" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${rpm.install.dir}/usr/bin">
|
||||
<fileset dir="${base.dir}/awsapi-setup/setup">
|
||||
<include name="*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="deploy-awsapi-db">
|
||||
<echo message="deploy-awsapi-db" />
|
||||
<exec dir="${db.dir}" executable="bash">
|
||||
<arg value="deploy-db-bridge.sh" />
|
||||
<arg value="${DBROOTPW}" />
|
||||
</exec>
|
||||
</target>
|
||||
<target name="download-ELB-wsdl">
|
||||
<echo message="downloading ElasticLoadBalancing.wsdl..." />
|
||||
<get src="http://elasticloadbalancing.amazonaws.com/doc/2011-04-05/ElasticLoadBalancing.wsdl" dest="wsdl/" verbose="true" usetimestamp="true" overwrite="false"/>
|
||||
</target>
|
||||
<target name="codegen-server-s3">
|
||||
<wsdl2code
|
||||
wsdlfilename="${base.dir}/wsdl/cloud-AmazonS3.wsdl"
|
||||
serverside="true"
|
||||
generateservicexml="true"
|
||||
skipbuildxml="true"
|
||||
serversideinterface="true"
|
||||
namespacetopackages="http://s3.amazonaws.com/doc/2006-03-01/=com.amazon.s3"
|
||||
targetsourcefolderlocation="src"
|
||||
targetresourcesfolderlocation="resource/AmazonS3"
|
||||
overwrite="true"
|
||||
/>
|
||||
</target>
|
||||
<target name="codegen-server-ec2">
|
||||
<wsdl2code wsdlfilename="${base.dir}/wsdl/AmazonEC2.wsdl" serverside="true" generateservicexml="true" skipbuildxml="true" serversideinterface="true" namespacetopackages="http://ec2.amazonaws.com/doc/2010-11-15/=com.amazon.ec2"
|
||||
targetsourcefolderlocation="src" targetresourcesfolderlocation="resource/AmazonEC2" overwrite="true" />
|
||||
</target>
|
||||
<target name="codegen-server-elb" depends="download-ELB-wsdl">
|
||||
<wsdl2code wsdlfilename="${base.dir}/wsdl/ElasticLoadBalancing.wsdl" serverside="true" generateservicexml="true" skipbuildxml="true" serversideinterface="true" namespacetopackages="http://elasticloadbalancing.amazonaws.com/doc/2011-04-05/=com.amazon.elb" targetsourcefolderlocation="src" targetresourcesfolderlocation="resource/AmazonELB" overwrite="true" />
|
||||
</target>
|
||||
<target name="codegen-client-s3">
|
||||
<wsdl2code wsdlfilename="${base.dir}/wsdl/cloud-AmazonS3.wsdl" serverside="false" generateservicexml="false" skipbuildxml="true" serversideinterface="false" namespacetopackages="http://s3.amazonaws.com/doc/2006-03-01/=com.amazon.s3.client" targetsourcefolderlocation="src" targetresourcesfolderlocation="resource/AmazonS3" overwrite="true" />
|
||||
</target>
|
||||
<target name="codegen-client-ec2">
|
||||
<wsdl2code wsdlfilename="${base.dir}/wsdl/AmazonEC2.wsdl" serverside="false" generateservicexml="false" skipbuildxml="true" serversideinterface="false" namespacetopackages="http://ec2.amazonaws.com/doc/2010-11-15/=com.amazon.ec2.clieent" targetsourcefolderlocation="src" targetresourcesfolderlocation="resource/AmazonEC2" overwrite="true" />
|
||||
</target>
|
||||
<target name="codegen-client-elb" depends="download-ELB-wsdl">
|
||||
<wsdl2code wsdlfilename="${base.dir}/wsdl/ElasticLoadBalancing.wsdl" serverside="false" generateservicexml="false" skipbuildxml="true" serversideinterface="false" namespacetopackages="http://elasticloadbalancing.amazonaws.com/doc/2011-04-05/=com.amazon.elb.client" targetsourcefolderlocation="src" targetresourcesfolderlocation="resource/AmazonELB" overwrite="true" />
|
||||
</target>
|
||||
</project>
|
||||
@ -1,328 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="Cloud Stack Plugins" default="help" basedir=".">
|
||||
|
||||
<target name="help">
|
||||
<echo level="info" message="Ant Build File for CloudStack Plugins" />
|
||||
<echo level="info" message="Type 'ant -projecthelp' to get a list of targets and their descriptions." />
|
||||
</target>
|
||||
|
||||
<description>
|
||||
Cloud Stack ant build file for building all the plugins
|
||||
</description>
|
||||
|
||||
<!--
|
||||
Test
|
||||
Always use this variable to refer to the base directory because this
|
||||
variable is changeable
|
||||
-->
|
||||
<dirname property="base.dir" file="${ant.file.Cloud Stack Plugins}/.." />
|
||||
<property name="build.dir" location="${base.dir}/build" />
|
||||
|
||||
<!-- Import anything that the user wants to set-->
|
||||
<!-- Import properties files and environment variables here -->
|
||||
|
||||
<property environment="env" />
|
||||
|
||||
<condition property="build-cloud.properties.file" value="${build.dir}/override/build-cloud.properties" else="${build.dir}/build-cloud.properties">
|
||||
<available file="${build.dir}/override/build-cloud.properties" />
|
||||
</condition>
|
||||
|
||||
<condition property="cloud.properties.file" value="${build.dir}/override/cloud.properties" else="${build.dir}/cloud.properties">
|
||||
<available file="${build.dir}/override/cloud.properties" />
|
||||
</condition>
|
||||
|
||||
<condition property="override.file" value="${build.dir}/override/replace.properties" else="${build.dir}/replace.properties">
|
||||
<available file="${build.dir}/override/replace.properties" />
|
||||
</condition>
|
||||
|
||||
<echo message="Using build parameters from ${build-cloud.properties.file}" />
|
||||
<property file="${build-cloud.properties.file}" />
|
||||
|
||||
<echo message="Using company info from ${cloud.properties.file}" />
|
||||
<property file="${cloud.properties.file}" />
|
||||
|
||||
<echo message="Using override file from ${override.file}" />
|
||||
<property file="${override.file}" />
|
||||
|
||||
<property file="${base.dir}/build/build.number" />
|
||||
|
||||
<import file="${build.dir}/build-common.xml" />
|
||||
|
||||
<!-- In case these didn't get defined in the build-cloud.properties -->
|
||||
<property name="branding.name" value="default" />
|
||||
<property name="tomcat.home" value="${env.CATALINA_HOME}" />
|
||||
<property name="deprecation" value="off" />
|
||||
<property name="target.compat.version" value="1.6" />
|
||||
<property name="source.compat.version" value="1.6" />
|
||||
<property name="debug" value="true" />
|
||||
<property name="debuglevel" value="lines,source"/>
|
||||
|
||||
<!-- directories for build and distribution -->
|
||||
<property name="dist.dir" location="${base.dir}/dist/" />
|
||||
<property name="target.dir" location="${base.dir}/target" />
|
||||
<property name="classes.dir" location="${target.dir}/classes" />
|
||||
<property name="jar.dir" location="${target.dir}/jar" />
|
||||
<property name="dep.cache.dir" location="${target.dir}/dep-cache" />
|
||||
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
|
||||
|
||||
<property name="deps.dir" location="${base.dir}/deps" />
|
||||
|
||||
<!-- directories for client compilation-->
|
||||
<property name="client.dir" location="${base.dir}/client" />
|
||||
<property name="client.test.dir" location="${client.dir}/test" />
|
||||
<property name="client.target.dir" location="${target.dir}/ui" />
|
||||
<property name="ui.user.dir" location="${base.dir}/ui" />
|
||||
<property name="setup.db.dir" location="${base.dir}/setup/db" />
|
||||
<property name="setup.apidoc.dir" location="${base.dir}/setup/apidoc" />
|
||||
|
||||
<!-- directories for server compilation-->
|
||||
<property name="server.dir" location="${base.dir}/server" />
|
||||
<property name="server.test.dir" location="${server.dir}/test" />
|
||||
<property name="server.dist.dir" location="${dist.dir}/client" />
|
||||
<property name="db.scripts.dir" location="${target.dir}/db"/>
|
||||
<property name="apidoc.scripts.dir" location="${base.dir}/setup/apidoc/"/>
|
||||
|
||||
<!-- directories for core code compilation-->
|
||||
<property name="core.dir" location="${base.dir}/core" />
|
||||
<property name="core.test.dir" location="${core.dir}/test/" />
|
||||
|
||||
<!-- directories for agent code compilation-->
|
||||
<property name="agent.dir" location="${base.dir}/agent" />
|
||||
<property name="agent.test.dir" location="${utils.dir}/test/" />
|
||||
<property name="agent.dist.dir" location="${dist.dir}/agent" />
|
||||
|
||||
<property name="scripts.dir" location="${base.dir}/scripts" />
|
||||
<property name="scripts.target.dir" location="${target.dir}/scripts"/>
|
||||
|
||||
<!-- directories for console proxy compilation-->
|
||||
<property name="console-proxy.dir" location="${base.dir}/console-proxy" />
|
||||
<property name="console-proxy.dist.dir" location="${dist.dir}/console-proxy" />
|
||||
|
||||
<property name="tools.dir" location="${base.dir}/tools" />
|
||||
<!-- <property name="antcontrib.dir" location="${tools.dir}/tools/ant/apache-ant-1.8.0/lib" />-->
|
||||
<property name="deploy.dir" location="${build.dir}/deploy" />
|
||||
<property name="meld.home" location="/usr/local/bin" />
|
||||
<property name="assertion" value="-da" />
|
||||
|
||||
<!-- directory for vmware-base library -->
|
||||
<property name="vmware-base.dir" location="${base.dir}/vmware-base" />
|
||||
|
||||
<!-- directories for branding -->
|
||||
<property name="branding.dir" location="${build.dir}/deploy/branding/${branding.name}" />
|
||||
|
||||
<property name="core.jar" value="cloud-core.jar" />
|
||||
<property name="utils.jar" value="cloud-utils.jar" />
|
||||
<property name="server.jar" value="cloud-server.jar" />
|
||||
<property name="agent.jar" value="cloud-agent.jar" />
|
||||
<property name="console-proxy.jar" value="cloud-console-proxy.jar" />
|
||||
<property name="api.jar" value="cloud-api.jar"/>
|
||||
<property name="vmware-base.jar" value="cloud-vmware-base.jar" />
|
||||
|
||||
<!--
|
||||
Import information about the build version and company information
|
||||
-->
|
||||
<property name="version" value="${company.major.version}.${company.minor.version}.${company.patch.version}" />
|
||||
|
||||
<!-- Class paths -->
|
||||
<path id="prod.src.path">
|
||||
<pathelement location="${server.dir}/src" />
|
||||
<pathelement location="${utils.dir}/src" />
|
||||
<pathelement location="${core.dir}/src" />
|
||||
<pathelement location="${agent.dir}/src" />
|
||||
</path>
|
||||
|
||||
<path id="src.classpath">
|
||||
</path>
|
||||
|
||||
<path id="compile.deps.classpath">
|
||||
</path>
|
||||
|
||||
<path id="deps.classpath">
|
||||
<!--filelist files="${deps.classpath}" /-->
|
||||
<fileset dir="${deps.dir}" erroronmissingdir="false">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<path refid="compile.deps.classpath" />
|
||||
</path>
|
||||
|
||||
<path id="dist.classpath">
|
||||
<fileset dir="${target.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${target.dir}/jar">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<path id="test.classpath">
|
||||
<fileset dir="${dist.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
|
||||
<target name="compile-plugins" description="Compile all of the jars corresponding to plugins" depends="compile-utils, compile-api, compile-core, compile-server, compile-hypervisors, compile-deployment-planners, compile-host-allocators, compile-network-elements, compile-user-authenticators, compile-storage-allocators"/>
|
||||
|
||||
<target name="build-plugins" depends="build-hypervisors, build-network-elements, build-deployment-planners, build-host-allocators, build-storage-allocators, build-user-authenticators" description="Builds all jar's for the plug-in's"/>
|
||||
|
||||
<target name="clean-plugins" description="Clean all of the generated files by the plugins">
|
||||
<delete file="${build.log}" />
|
||||
<delete dir="${classes.dir}" />
|
||||
<delete dir="${jar.dir}" />
|
||||
<delete dir="${dist.files.dir}" />
|
||||
<delete dir="${target.dir}" />
|
||||
</target>
|
||||
|
||||
<!-- ===================== Hypervisors ========================= -->
|
||||
|
||||
<target name="compile-hypervisors" depends="compile-kvm, compile-ovm, compile-xen" description="Compile all hypervisors"/>
|
||||
<target name="build-hypervisors" depends="build-kvm, build-ovm, build-xen " description="Builds all hypervisors"/>
|
||||
|
||||
<target name="compile-kvm" depends="-init, compile-core, compile-agent" description="Compile KVM">
|
||||
<ant antfile="${base.dir}/plugins/hypervisors/kvm/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-kvm" depends="compile-kvm" />
|
||||
|
||||
<target name="compile-ovm" depends="-init, compile-server" description="Compile OVM">
|
||||
<ant antfile="${base.dir}/plugins/hypervisors/ovm/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-ovm" depends="compile-ovm" />
|
||||
|
||||
|
||||
<target name="compile-xen" depends="-init, compile-server, compile-ovs" description="Compiles Xen ">
|
||||
<ant antfile="${base.dir}/plugins/hypervisors/xen/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-xen" depends="compile-xen" />
|
||||
|
||||
<target name="compile-vmware" depends="-init, compile-server" description="Compiles Vmware">
|
||||
<ant antfile="${base.dir}/plugins/hypervisors/vmware/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-vmware" depends="compile-vmware" />
|
||||
|
||||
|
||||
<!-- ===================== Deployment Planners ================= -->
|
||||
|
||||
<target name="compile-deployment-planners" depends="compile-dp-user-dispersing, compile-dp-user-concentrated-pod" description="Compile all dp's"/>
|
||||
<target name="build-deployment-planners" depends="build-dp-user-dispersing, build-dp-user-concentrated-pod" description="builds all dp's"/>
|
||||
|
||||
<target name="compile-dp-user-dispersing" depends="-init, compile-server" description="Compile dp-user-dispersing">
|
||||
<ant antfile="${base.dir}/plugins/deployment-planners/user-dispersing/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-dp-user-dispersing" depends="compile-dp-user-dispersing" />
|
||||
|
||||
<target name="compile-dp-user-concentrated-pod" depends="-init, compile-server" description="Compile ">
|
||||
<ant antfile="${base.dir}/plugins/deployment-planners/user-concentrated-pod/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-dp-user-concentrated-pod" depends="compile-dp-user-concentrated-pod" />
|
||||
|
||||
|
||||
<!-- ===================== Host Allocators ===================== -->
|
||||
|
||||
<target name="compile-host-allocators" depends="compile-host-allocator-random" description="Compile all host allocators"/>
|
||||
<target name="build-host-allocators" depends="build-host-allocator-random" description="builds all host allocators"/>
|
||||
|
||||
<target name="compile-host-allocator-random" depends="-init, compile-server" description="Compile ">
|
||||
<ant antfile="${base.dir}/plugins/host-allocators/random/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-host-allocator-random" depends="compile-host-allocator-random" />
|
||||
|
||||
|
||||
<!-- ===================== Storage Allocators ===================== -->
|
||||
|
||||
<target name="compile-storage-allocators" depends="compile-storage-allocator-random" description="Compile all storage allocators"/>
|
||||
<target name="build-storage-allocators" depends="build-storage-allocator-random" description="builds all storage allocators"/>
|
||||
|
||||
<target name="compile-storage-allocator-random" depends="-init, compile-server" description="Compile ">
|
||||
<ant antfile="${base.dir}/plugins/storage-allocators/random/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-storage-allocator-random" depends="compile-storage-allocator-random" />
|
||||
|
||||
|
||||
<!-- ===================== User Authenticators ================== -->
|
||||
|
||||
<target name="compile-user-authenticators" depends="compile-user-authenticator-ldap, compile-user-authenticator-md5, compile-user-authenticator-plaintext" description="Compile all user authenicators"/>
|
||||
<target name="build-user-authenticators" depends="build-user-authenticator-ldap, build-user-authenticator-md5, build-user-authenticator-plaintext" description="builds all user authenticators"/>
|
||||
|
||||
<target name="compile-user-authenticator-ldap" depends="-init, compile-server" description="Compiles LDAP user authenticator">
|
||||
<ant antfile="${base.dir}/plugins/user-authenticators/ldap/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-user-authenticator-ldap" depends="compile-user-authenticator-ldap" />
|
||||
|
||||
<target name="compile-user-authenticator-md5" depends="-init, compile-server" description="Compiles MD5 user authenticator">
|
||||
<ant antfile="${base.dir}/plugins/user-authenticators/md5/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-user-authenticator-md5" depends="compile-user-authenticator-md5" />
|
||||
|
||||
<target name="compile-user-authenticator-plaintext" depends="-init, compile-server" description="Compiles plaintext user authenticator">
|
||||
<ant antfile="${base.dir}/plugins/user-authenticators/plain-text/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-user-authenticator-plaintext" depends="compile-user-authenticator-plaintext" />
|
||||
|
||||
|
||||
<!-- ===================== Network Elements ===================== -->
|
||||
|
||||
<target name="compile-network-elements" depends="compile-ovs, compile-elb, compile-nicira-nvp" description="Compile all network elements"/>
|
||||
<target name="build-network-elements" depends="build-ovs, build-elb, build-nicira-nvp" description="build all network elements"/>
|
||||
|
||||
<target name="compile-netscaler" depends="-init, compile-server" description="Compile NetScaler plugin">
|
||||
<ant antfile="${base.dir}/plugins/network-elements/netscaler/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-netscaler" depends="compile-netscaler"/>
|
||||
|
||||
<target name="compile-f5" depends="-init, compile-server" description="Compile F5 plugin">
|
||||
<ant antfile="${base.dir}/plugins/network-elements/f5/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-f5" depends="compile-f5"/>
|
||||
|
||||
<target name="compile-srx" depends="-init, compile-server" description="Compile SRX plugin">
|
||||
<ant antfile="${base.dir}/plugins/network-elements/juniper-srx/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-srx" depends="compile-srx"/>
|
||||
|
||||
<target name="compile-ovs" depends="-init, compile-server" description="Compile Ovs plugin">
|
||||
<ant antfile="${base.dir}/plugins/network-elements/ovs/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-ovs" depends="compile-ovs"/>
|
||||
|
||||
<target name="compile-nicira-nvp" depends="-init, compile-server" description="Compile Nicira NVP plugin">
|
||||
<ant antfile="${base.dir}/plugins/network-elements/nicira-nvp/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-nicira-nvp" depends="compile-nicira-nvp"/>
|
||||
|
||||
|
||||
<target name="compile-elb" depends="-init, compile-server" description="Compile ELB plugin">
|
||||
<ant antfile="${base.dir}/plugins/network-elements/elastic-loadbalancer/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-elb" depends="compile-elb"/>
|
||||
|
||||
|
||||
<!-- ===================== File Systems ===================== -->
|
||||
|
||||
<target name="compile-file-systems" depends="compile-netapp" description="Compils all supported file systems"/>
|
||||
<target name="build-file-systems" depends="build-netapp" description="Builds all supported file systems"/>
|
||||
|
||||
<target name="compile-netapp" depends="-init, compile-server" description="Compile NetApp plugin">
|
||||
<ant antfile="${base.dir}/plugins/file-systems/netapp/build.xml" target="build"/>
|
||||
</target>
|
||||
<target name="build-netapp" depends="compile-netapp"/>
|
||||
|
||||
|
||||
</project>
|
||||
@ -1,26 +0,0 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
|
||||
debug=true
|
||||
debuglevel=lines,source,vars
|
||||
debug.jvmarg=-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
|
||||
deprecation=off
|
||||
build.type=developer
|
||||
target.compat.version=1.6
|
||||
source.compat.version=1.6
|
||||
branding.name=default
|
||||
ssvm.include.vmware.jar=true
|
||||
@ -1,595 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="Cloud Stack" default="help" basedir=".">
|
||||
<description>
|
||||
Cloud Stack ant build file
|
||||
</description>
|
||||
|
||||
<!--
|
||||
Test
|
||||
Always use this variable to refer to the base directory because this
|
||||
variable is changeable
|
||||
-->
|
||||
<dirname property="base.dir" file="${ant.file.Cloud Stack}/.." />
|
||||
<property name="build.dir" location="${base.dir}/build" />
|
||||
|
||||
<!-- Import anything that the user wants to set-->
|
||||
<!-- Import properties files and environment variables here -->
|
||||
|
||||
<property environment="env" />
|
||||
|
||||
<condition property="build-cloud.properties.file" value="${build.dir}/override/build-cloud.properties" else="${build.dir}/build-cloud.properties">
|
||||
<available file="${build.dir}/override/build-cloud.properties" />
|
||||
</condition>
|
||||
|
||||
<condition property="cloud.properties.file" value="${build.dir}/override/cloud.properties" else="${build.dir}/cloud.properties">
|
||||
<available file="${build.dir}/override/cloud.properties" />
|
||||
</condition>
|
||||
|
||||
<condition property="override.file" value="${build.dir}/override/replace.properties" else="${build.dir}/replace.properties">
|
||||
<available file="${build.dir}/override/replace.properties" />
|
||||
</condition>
|
||||
|
||||
<echo message="Using build parameters from ${build-cloud.properties.file}" />
|
||||
<property file="${build-cloud.properties.file}" />
|
||||
|
||||
<echo message="Using company info from ${cloud.properties.file}" />
|
||||
<property file="${cloud.properties.file}" />
|
||||
|
||||
<echo message="Using override file from ${override.file}" />
|
||||
<property file="${override.file}" />
|
||||
|
||||
<property file="${base.dir}/build/build.number" />
|
||||
|
||||
<import file="${build.dir}/build-common.xml" />
|
||||
|
||||
<!-- In case these didn't get defined in the build-cloud.properties -->
|
||||
<property name="tomcat.home" value="${env.CATALINA_HOME}" />
|
||||
<property name="deprecation" value="off" />
|
||||
<property name="target.compat.version" value="1.6" />
|
||||
<property name="source.compat.version" value="1.6" />
|
||||
<property name="debug" value="true" />
|
||||
<property name="debuglevel" value="lines,source"/>
|
||||
|
||||
<!-- directories for build and distribution -->
|
||||
<property name="dist.dir" location="${base.dir}/dist/" />
|
||||
<property name="target.dir" location="${base.dir}/target" />
|
||||
<property name="classes.dir" location="${target.dir}/classes" />
|
||||
<property name="jar.dir" location="${target.dir}/jar" />
|
||||
<property name="dep.cache.dir" location="${target.dir}/dep-cache" />
|
||||
<property name="build.log" location="${target.dir}/ant_verbose.txt" />
|
||||
|
||||
<property name="deps.dir" location="${base.dir}/deps" />
|
||||
<property name="xenapi.dir" location="${deps.dir}/XenServerJava" />
|
||||
|
||||
<!-- directories for client compilation-->
|
||||
<property name="client.dir" location="${base.dir}/client" />
|
||||
<property name="client.test.dir" location="${client.dir}/test" />
|
||||
<property name="client.target.dir" location="${target.dir}/ui" />
|
||||
<property name="ui.user.dir" location="${base.dir}/ui" />
|
||||
<property name="setup.db.dir" location="${base.dir}/setup/db" />
|
||||
<property name="setup.apidoc.dir" location="${base.dir}/setup/apidoc" />
|
||||
|
||||
<!-- directories for server compilation-->
|
||||
<property name="server.dir" location="${base.dir}/server" />
|
||||
<property name="server.test.dir" location="${server.dir}/test" />
|
||||
<property name="server.dist.dir" location="${dist.dir}/client" />
|
||||
<property name="db.scripts.dir" location="${target.dir}/db"/>
|
||||
<property name="apidoc.scripts.dir" location="${base.dir}/setup/apidoc/"/>
|
||||
|
||||
<!-- directories for core code compilation-->
|
||||
<property name="core.dir" location="${base.dir}/core" />
|
||||
<property name="core.test.dir" location="${core.dir}/test/" />
|
||||
|
||||
<!-- directories for agent code compilation-->
|
||||
<property name="agent.dir" location="${base.dir}/agent" />
|
||||
<property name="agent.test.dir" location="${utils.dir}/test/" />
|
||||
<property name="agent.dist.dir" location="${dist.dir}/agent" />
|
||||
|
||||
<property name="scripts.dir" location="${base.dir}/scripts" />
|
||||
<property name="scripts.target.dir" location="${target.dir}/scripts"/>
|
||||
|
||||
<!-- directories for console proxy compilation-->
|
||||
<property name="console-proxy.dir" location="${base.dir}/console-proxy" />
|
||||
<property name="console-proxy.dist.dir" location="${dist.dir}/console-proxy" />
|
||||
|
||||
<property name="tools.dir" location="${base.dir}/tools" />
|
||||
<!-- <property name="antcontrib.dir" location="${tools.dir}/tools/ant/apache-ant-1.8.0/lib" />-->
|
||||
<property name="meld.home" location="/usr/local/bin" />
|
||||
<property name="assertion" value="-da" />
|
||||
|
||||
<!-- directory for vmware-base library -->
|
||||
<property name="vmware-base.dir" location="${base.dir}/vmware-base" />
|
||||
|
||||
<property name="core.jar" value="cloud-core.jar" />
|
||||
<property name="utils.jar" value="cloud-utils.jar" />
|
||||
<property name="server.jar" value="cloud-server.jar" />
|
||||
<property name="agent.jar" value="cloud-agent.jar" />
|
||||
<property name="console-proxy.jar" value="cloud-console-proxy.jar" />
|
||||
<property name="api.jar" value="cloud-api.jar"/>
|
||||
<property name="xenapi.jar" value="cloud-xenapi.jar" />
|
||||
<property name="vmware-base.jar" value="cloud-vmware-base.jar" />
|
||||
<property name="vmware.jar" value="cloud-vmware.jar" />
|
||||
|
||||
<!--
|
||||
Import information about the build version and company information
|
||||
-->
|
||||
<property name="version" value="${company.major.version}.${company.minor.version}.${company.patch.version}" />
|
||||
|
||||
<!-- Class paths -->
|
||||
<path id="prod.src.path">
|
||||
<pathelement location="${server.dir}/src" />
|
||||
<pathelement location="${utils.dir}/src" />
|
||||
<pathelement location="${core.dir}/src" />
|
||||
<pathelement location="${agent.dir}/src" />
|
||||
</path>
|
||||
|
||||
<path id="src.classpath">
|
||||
</path>
|
||||
|
||||
<path id="compile.deps.classpath">
|
||||
</path>
|
||||
|
||||
<path id="deps.classpath">
|
||||
<!--filelist files="${deps.classpath}" /-->
|
||||
<fileset dir="${deps.dir}" erroronmissingdir="false">
|
||||
<include name="*.jar" />
|
||||
</fileset>
|
||||
<path refid="compile.deps.classpath" />
|
||||
</path>
|
||||
|
||||
<path id="dist.classpath">
|
||||
<fileset dir="${target.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${target.dir}/jar">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<path id="test.classpath">
|
||||
<fileset dir="${dist.dir}">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<!-- directories for util code compilation-->
|
||||
<property name="utils.dir" location="${base.dir}/utils" />
|
||||
<property name="utils.test.dir" location="${utils.dir}/test/" />
|
||||
<path id="utils.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
</path>
|
||||
<target name="compile-utils" depends="-init" description="Compile the utilities jar that is shared.">
|
||||
<compile-java jar.name="${utils.jar}" top.dir="${utils.dir}" classpath="utils.classpath" >
|
||||
<include-files>
|
||||
<fileset dir="${utils.dir}/certs">
|
||||
<include name="*.keystore" />
|
||||
</fileset>
|
||||
</include-files>
|
||||
</compile-java>
|
||||
</target>
|
||||
|
||||
<property name="api.dir" location="${base.dir}/api" />
|
||||
<property name="api.test.dir" location="${api.dir}/test/" />
|
||||
<path id="api.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath"/>
|
||||
</path>
|
||||
<target name="compile-api" depends="-init, compile-utils" description="Compile the utilities jar that is shared.">
|
||||
<compile-java jar.name="${api.jar}" top.dir="${api.dir}" classpath="api.classpath" />
|
||||
</target>
|
||||
|
||||
<path id="core.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath" />
|
||||
</path>
|
||||
<target name="compile-core" depends="-init, compile-utils, compile-api" description="Compile the core business logic.">
|
||||
<compile-java jar.name="${core.jar}" top.dir="${core.dir}" classpath="core.classpath" />
|
||||
</target>
|
||||
|
||||
<path id="vmware-base.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath" />
|
||||
</path>
|
||||
<target name="compile-vmware-base" depends="-init, compile-utils" description="Compile the VMware support library">
|
||||
<compile-java jar.name="${vmware-base.jar}" top.dir="${vmware-base.dir}" classpath="vmware-base.classpath" />
|
||||
</target>
|
||||
|
||||
<path id="xenapi.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath" />
|
||||
</path>
|
||||
<target name="compile-xenapi" depends="-init" description="Compile XenServer java sdk.">
|
||||
<compile-java jar.name="${xenapi.jar}" top.dir="${xenapi.dir}" classpath="xenapi.classpath" />
|
||||
</target>
|
||||
|
||||
<path id="server.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath" />
|
||||
</path>
|
||||
<target name="compile-server" depends="-init, compile-utils, compile-core, compile-agent" description="Compile the management server.">
|
||||
<compile-java jar.name="${server.jar}" top.dir="${server.dir}" classpath="server.classpath" />
|
||||
</target>
|
||||
|
||||
<path id="client.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath" />
|
||||
</path>
|
||||
|
||||
<target name="build-scripts" depends="-init">
|
||||
<copy todir="${scripts.target.dir}">
|
||||
<fileset dir="${scripts.dir}">
|
||||
<include name="**/*"/>
|
||||
<exclude name="**/fsimage.so"/>
|
||||
<exclude name="**/ping.tar.bz2"/>
|
||||
<exclude name="**/vhd-util"/>
|
||||
<exclude name="**/.*" />
|
||||
</fileset>
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${impl.version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
<copy todir="${scripts.target.dir}">
|
||||
<fileset dir="${scripts.dir}">
|
||||
<include name="**/fsimage.so"/>
|
||||
<include name="**/ping.tar.bz2"/>
|
||||
<include name="**/vhd-util"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="build-ui" depends="-init" description="Builds the UI">
|
||||
<mkdir dir="${client.target.dir}" />
|
||||
<copy todir="${client.target.dir}">
|
||||
<fileset dir="${ui.user.dir}">
|
||||
<include name="**/*.html" />
|
||||
<include name="**/*.js"/>
|
||||
<include name="**/*.jsp"/>
|
||||
<exclude name="**/.classpath" />
|
||||
<exclude name="**/.project" />
|
||||
</fileset>
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${impl.version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
<copy todir="${client.target.dir}">
|
||||
<fileset dir="${ui.user.dir}">
|
||||
<include name="**/*"/>
|
||||
<exclude name="**/*.html" />
|
||||
<exclude name="**/*.js"/>
|
||||
<exclude name="**/*.jsp"/>
|
||||
<exclude name="**/.classpath" />
|
||||
<exclude name="**/.project" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${client.target.dir}">
|
||||
<fileset dir="${client.dir}/WEB-INF/classes">
|
||||
<include name="**/*.properties"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="build-server" depends="compile-server">
|
||||
<mkdir dir="${server.dist.dir}" />
|
||||
<mkdir dir="${server.dist.dir}/lib" />
|
||||
<mkdir dir="${server.dist.dir}/conf" />
|
||||
|
||||
<copy todir="${jar.dir}">
|
||||
<fileset dir="${deps.dir}">
|
||||
<include name="cloud-*.jar"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy overwrite="true" todir="${server.dist.dir}/conf">
|
||||
<fileset dir="${base.dir}/client/tomcatconf">
|
||||
<include name="*.in" />
|
||||
</fileset>
|
||||
<globmapper from="*.in" to="*" />
|
||||
<filterchain>
|
||||
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
|
||||
<param type="propertiesfile" value="${override.file}" />
|
||||
</filterreader>
|
||||
</filterchain>
|
||||
</copy>
|
||||
|
||||
<copy overwrite="true" todir="${server.dist.dir}/conf">
|
||||
<fileset dir="${server.dir}/src/com/cloud/migration">
|
||||
<include name="*.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy overwrite="true" todir="${db.scripts.dir}">
|
||||
<fileset dir="${setup.db.dir}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${impl.version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<path id="console-proxy.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath" />
|
||||
</path>
|
||||
<target name="compile-console-proxy" depends="-init" description="Compile the console proxy.">
|
||||
<compile-java jar.name="${console-proxy.jar}" top.dir="${console-proxy.dir}" classpath="console-proxy.classpath" >
|
||||
<include-files>
|
||||
<fileset dir="${console-proxy.dir}/certs">
|
||||
<include name="*.keystore" />
|
||||
<include name="*.crt" />
|
||||
<include name="*.key" />
|
||||
</fileset>
|
||||
</include-files>
|
||||
</compile-java>
|
||||
</target>
|
||||
|
||||
<target name="copy-console-proxy" depends="-init">
|
||||
<property name="copyto.dir" value="${console-proxy.dist.dir}" />
|
||||
<mkdir dir="${copyto.dir}" />
|
||||
<mkdir dir="${copyto.dir}/conf" />
|
||||
<mkdir dir="${copyto.dir}/logs" />
|
||||
<mkdir dir="${copyto.dir}/applet" />
|
||||
<mkdir dir="${copyto.dir}/images" />
|
||||
<mkdir dir="${copyto.dir}/js" />
|
||||
<mkdir dir="${copyto.dir}/ui" />
|
||||
<mkdir dir="${copyto.dir}/css" />
|
||||
<mkdir dir="${copyto.dir}/certs" />
|
||||
|
||||
<copy todir="${copyto.dir}">
|
||||
<fileset dir="${deps.dir}">
|
||||
<include name="log4j-1.2.15.jar" />
|
||||
<include name="apache-log4j-extras-1.0.jar" />
|
||||
<include name="gson.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${copyto.dir}">
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="cloud-console-proxy.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${copyto.dir}/conf">
|
||||
<fileset dir="${console-proxy.dir}/conf">
|
||||
<include name="log4j-cloud.xml" />
|
||||
<include name="consoleproxy.properties" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${copyto.dir}/images">
|
||||
<fileset dir="${console-proxy.dir}/images">
|
||||
<include name="*.jpg" />
|
||||
<include name="*.gif" />
|
||||
<include name="*.png" />
|
||||
<include name="*.cur" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${copyto.dir}/js">
|
||||
<fileset dir="${console-proxy.dir}/js">
|
||||
<include name="*.js" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${copyto.dir}/ui">
|
||||
<fileset dir="${console-proxy.dir}/ui">
|
||||
<include name="*.ftl" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${copyto.dir}/css">
|
||||
<fileset dir="${console-proxy.dir}/css">
|
||||
<include name="*.css" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${copyto.dir}/certs">
|
||||
<fileset dir="${console-proxy.dir}/certs">
|
||||
<include name="*.keystore" />
|
||||
<include name="*.crt" />
|
||||
<include name="*.key" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="build-console-proxy" depends="-init, compile-console-proxy, copy-console-proxy">
|
||||
<copy todir="${console-proxy.dist.dir}">
|
||||
<fileset dir="${console-proxy.dir}/scripts">
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy todir="${console-proxy.dist.dir}/conf">
|
||||
<fileset dir="${console-proxy.dir}/conf">
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
|
||||
<path id="agent.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<fileset dir="${target.dir}">
|
||||
<include name="**/${core.jar}" />
|
||||
<include name="**/${utils.jar}" />
|
||||
<include name="**/${api.jar}"/>
|
||||
</fileset>
|
||||
</path>
|
||||
<target name="compile-agent" depends="-init, compile-utils, compile-core, compile-api" description="Compile the management agent.">
|
||||
<compile-java jar.name="${agent.jar}" top.dir="${agent.dir}" classpath="agent.classpath" />
|
||||
</target>
|
||||
|
||||
<target name="build-agent" depends="-init, compile-agent">
|
||||
<mkdir dir="${agent.dist.dir}" />
|
||||
<mkdir dir="${agent.dist.dir}/scripts" />
|
||||
<mkdir dir="${agent.dist.dir}/conf" />
|
||||
<mkdir dir="${agent.dist.dir}/logs" />
|
||||
<mkdir dir="${agent.dist.dir}/db" />
|
||||
<mkdir dir="${agent.dist.dir}/storagehdpatch" />
|
||||
|
||||
<condition property="agent.properties" value="override/agent.properties" else="agent.properties">
|
||||
<available file="${agent.dir}/conf/override/agent.properties" />
|
||||
</condition>
|
||||
|
||||
<condition property="developer.properties" value="override/developer.properties" else="developer.properties">
|
||||
<available file="${agent.dir}/conf/override/developer.properties" />
|
||||
</condition>
|
||||
|
||||
<copy overwrite="true" todir="${agent.dist.dir}/conf" flatten="true">
|
||||
<fileset dir="${agent.dir}/conf">
|
||||
<include name="${agent.properties}" />
|
||||
<include name="${developer.properties}" />
|
||||
</fileset>
|
||||
<filterchain>
|
||||
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
|
||||
<param type="propertiesfile" value="${override.file}" />
|
||||
</filterreader>
|
||||
</filterchain>
|
||||
</copy>
|
||||
|
||||
<copy overwrite="true" todir="${agent.dist.dir}/conf" flatten="true">
|
||||
<fileset dir="${agent.dir}/conf">
|
||||
<include name="log4j-cloud.xml.in" />
|
||||
</fileset>
|
||||
<globmapper from="*.in" to="*" />
|
||||
<filterchain>
|
||||
<filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
|
||||
<param type="propertiesfile" value="${override.file}" />
|
||||
</filterreader>
|
||||
</filterchain>
|
||||
</copy>
|
||||
<delete file="${agent.dist.dir}/conf/log4j-cloud.xml.in"/>
|
||||
|
||||
<copy todir="${agent.dist.dir}">
|
||||
<fileset dir="${agent.dir}/scripts">
|
||||
<include name="agent.sh" />
|
||||
<include name="run.sh" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="build-servers" depends="-init, build-server" />
|
||||
|
||||
<target name="build-opensource" depends="-init, build-server, build-agent, build-scripts, build-ui, build-console-proxy, package-oss-systemvm-iso">
|
||||
<fileset dir="${base.dir}/client">
|
||||
<include name="setup/**/*" />
|
||||
</fileset>
|
||||
|
||||
<copy overwrite="true" todir="${jar.dir}">
|
||||
<fileset dir="${deps.dir}">
|
||||
<include name="vmware-*.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
<target name="build-systemvm-patch" depends="-init">
|
||||
<mkdir dir="${dist.dir}" />
|
||||
<mkdir dir="${dist.dir}/build-patch" />
|
||||
<mkdir dir="${dist.dir}/build-patch/usr/sbin" />
|
||||
<copy overwrite="true" todir="${dist.dir}/build-patch">
|
||||
<fileset dir="${base.dir}/patches/systemvm/debian/config/" >
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
<fileset dir="${base.dir}/patches/systemvm/debian/vpn/" >
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
<fileset dir="${base.dir}/patches/systemvm/debian/xe/" >
|
||||
<include name="**/*"/>
|
||||
<exclude name="**/xe-*" />
|
||||
<exclude name="**/xen-*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${dist.dir}/build-patch/usr/sbin/">
|
||||
<fileset dir="${base.dir}/patches/systemvm/debian/xe/" >
|
||||
<include name="**/xe-*" />
|
||||
<include name="**/xen-*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<tar destfile="${dist.dir}/patch.tar">
|
||||
<tarfileset dir="${dist.dir}/build-patch/" filemode="755">
|
||||
<include name="**/*"/>
|
||||
<exclude name="**/.classpath" />
|
||||
<exclude name="**/.project" />
|
||||
<exclude name="**/wscript_build" />
|
||||
</tarfileset>
|
||||
</tar>
|
||||
<copy file="${base.dir}/patches/systemvm/debian/config/root/.ssh/authorized_keys" todir="${dist.dir}/"/>
|
||||
<gzip destfile="${dist.dir}/cloud-scripts.tgz" src="${dist.dir}/patch.tar"/>
|
||||
</target>
|
||||
|
||||
<target name="help">
|
||||
<echo level="info" message="Ant Build File for CloudStack" />
|
||||
<echo level="info" message="Type 'ant -projecthelp' to get a list of targets and their descriptions." />
|
||||
</target>
|
||||
<target name="usage" depends="help" />
|
||||
|
||||
<target name="-init">
|
||||
<mkdir dir="${dist.dir}" />
|
||||
<mkdir dir="${target.dir}" />
|
||||
<record name="${build.log}" loglevel="verbose" action="start" />
|
||||
|
||||
<!-- create a UTC build timestamp using ISO 8601 formatting -->
|
||||
<tstamp>
|
||||
<format property="utc.build.timestamp" pattern="yyyy-MM-dd'T'HH:mm:ss'Z'" timezone="GMT" />
|
||||
</tstamp>
|
||||
|
||||
<!-- remember who/where did the build -->
|
||||
<exec executable="hostname" outputproperty="host.name" />
|
||||
<property name="builder.at" value="${user.name} at ${host.name}" />
|
||||
<property name="builder.id" value="${builder.at}, on ${utc.build.timestamp}" />
|
||||
<property name="built.by" value="${builder.at}, ${utc.build.timestamp}" />
|
||||
<echo level="info" message="builder: ${builder.id}" />
|
||||
|
||||
<!-- set build.number property, stored in eponymous file -->
|
||||
<buildnumber file="${build.dir}/build.number" />
|
||||
<condition property="impl.version" value="${version}.${manual.build.number}" else="${version}.${utc.build.timestamp}">
|
||||
<isset property="manual.build.number"/>
|
||||
</condition>
|
||||
|
||||
<echo message="Build number is ${impl.version}" />
|
||||
|
||||
<!-- Create the build directory structure used by compile -->
|
||||
<mkdir dir="${jar.dir}" />
|
||||
<mkdir dir="${docs.dir}" />
|
||||
<mkdir dir="${dep.cache.dir}" />
|
||||
|
||||
<condition property="mvn" value="mvn.bat" else="mvn">
|
||||
<os family="Windows"/>
|
||||
</condition>
|
||||
<!-- Download all dependencies using maven -->
|
||||
<exec executable="${mvn}" resolveexecutable="true" searchpath="true" failifexecutionfails="false">
|
||||
<arg value="-P"/>
|
||||
<arg value="deps"/>
|
||||
<arg value="-pl"/>
|
||||
<arg value="deps"/>
|
||||
</exec>
|
||||
<record name="${build.log}" action="stop" />
|
||||
</target>
|
||||
|
||||
<target name="clean" description="clean up files generated by the build">
|
||||
<delete file="${build.log}" />
|
||||
<delete dir="${classes.dir}" />
|
||||
<delete dir="${jar.dir}" />
|
||||
<delete dir="${dist.dir}" />
|
||||
<delete dir="${unittest.dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="compile-all" description="Compile all of the jars" depends="compile-utils, compile-api, compile-core, compile-server, compile-plugins"/>
|
||||
|
||||
<target name="clean-all" depends="clean, clean-plugins, clean-awsapi" description="Clean all of the generated files, including dependency cache and javadoc">
|
||||
<delete dir="${target.dir}" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@ -1,100 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="VMOps-Common" default="help" basedir=".">
|
||||
<!--
|
||||
compile-java requires the following parameters
|
||||
- top.dir = the root directory of the source.
|
||||
- jar.name = name of the jar file.
|
||||
- classpath = classpath to use for this compile
|
||||
|
||||
|
||||
The directory structure under the ${top.dir} needs to be.
|
||||
- src
|
||||
|
||||
The target files are generated to ${classes.dir}/${jar.name}.
|
||||
The jar file is generated to ${dist.dir}/${jar.name}.jar.
|
||||
-->
|
||||
<target name="help">
|
||||
<echo message="This file is meant to be imported by other build.xml to provide common
|
||||
functionality. Don not edit this file unless you are sure about adding
|
||||
common functionality."/>
|
||||
</target>
|
||||
|
||||
<dirname property="base.dir" file="${ant.file.VMOps-Common}/.."/>
|
||||
<property name="build.dir" location="${base.dir}/build"/>
|
||||
|
||||
<property name="target.dir" location="${base.dir}/target"/>
|
||||
<property name="classes.dir" location="${target.dir}/classes"/>
|
||||
<property name="tests.dir" location="${target.dir}/tests"/>
|
||||
<property name="jar.dir" location="${target.dir}/jar"/>
|
||||
<property name="dep.cache.dir" location="${target.dir}/dep-cache"/>
|
||||
<property name="debug" value="true"/>
|
||||
<property name="debuglevel" value="lines,source"/>
|
||||
|
||||
<macrodef name="compile-java">
|
||||
<attribute name="top.dir" description="Top Directory of the source. We will add src to this to get the source code."/>
|
||||
<attribute name="jar.name" description="Name of the jar file"/>
|
||||
<attribute name="classpath" description="class path to use"/>
|
||||
<element name="include-files" optional="true"/>
|
||||
<element name="exclude-files" optional="true"/>
|
||||
|
||||
<sequential>
|
||||
|
||||
<mkdir dir="${classes.dir}/@{jar.name}"/>
|
||||
|
||||
<depend srcdir="@{top.dir}/src" destdir="${classes.dir}/@{jar.name}" cache="${dep.cache.dir}" />
|
||||
|
||||
<echo message="Compiling @{top.dir}/src"/>
|
||||
<javac srcdir="@{top.dir}/src" debug="${debug}" debuglevel="${debuglevel}" deprecation="${deprecation}" destdir="${classes.dir}/@{jar.name}" source="${source.compat.version}" target="${target.compat.version}" includeantruntime="false" compiler="javac1.6" memoryinitialsize="512m" memorymaximumsize="1024m" fork="true">
|
||||
<!-- compilerarg line="-processor com.cloud.annotation.LocalProcessor -processorpath ${base.dir}/tools/src -Xlint:all"/ -->
|
||||
<!-- compilerarg line="-processor com.cloud.utils.LocalProcessor -processorpath ${base.dir}/utils/src -Xlint:all"/ -->
|
||||
<compilerarg line="-Xlint:-path"/>
|
||||
<classpath refid="@{classpath}" />
|
||||
<exclude-files/>
|
||||
</javac>
|
||||
<jar jarfile="${jar.dir}/@{jar.name}" basedir="${classes.dir}/@{jar.name}" update="true">
|
||||
<manifest>
|
||||
<attribute name="Class-Path" value="" />
|
||||
<attribute name="Built-By" value="${built.by}" />
|
||||
<attribute name="Specification-Title" value="Apache Cloud Stack" />
|
||||
<attribute name="Specification-Version" value="${impl.version}" />
|
||||
<attribute name="Specification-Vendor" value="${company.name}" />
|
||||
<attribute name="Implementation-Title" value="@{jar.name}" />
|
||||
<attribute name="Implementation-Version" value="${impl.version}" />
|
||||
<attribute name="Implementation-Vendor" value="${company.name}" />
|
||||
</manifest>
|
||||
<include-files/>
|
||||
</jar>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<macrodef name="clean-java">
|
||||
<attribute name="top.dir" description="Top Directory of the source. We will add src to this to get the source code."/>
|
||||
<attribute name="jar.name" description="Name of the jar file"/>
|
||||
|
||||
<sequential>
|
||||
<local name="compile.java.bin.dir"/>
|
||||
<property name="compile.java.bin.dir" location="${classes.dir}/@{jar.name}" />
|
||||
<rmdir dir="${compile.java.bin.dir}"/>
|
||||
<rm file="${jar.dir}/@{jar.name}"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
</project>
|
||||
@ -1,98 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="CloudDev Targets" basedir=".">
|
||||
|
||||
|
||||
<condition property="port" value="${rport}" else="2222">
|
||||
<isset property="rport"/>
|
||||
</condition>
|
||||
|
||||
<condition property="host" value="${rhost}" else="localhost">
|
||||
<isset property="rhost"/>
|
||||
</condition>
|
||||
|
||||
<target name="deploydbIfSet" if="deploydb.is.set">
|
||||
<echo message="ant deploydb"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="echo $CATALINA_HOME; export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32;killall java; service cloud-management stop;cd /opt/cloudstack/incubator-cloudstack;ant deploycddb"/>
|
||||
</target>
|
||||
|
||||
<target name="rdeploydb">
|
||||
<echo message="ant rdeploydb"/>
|
||||
<sshexec trust="yes" host="${host}" port="${port}" username="root" password="password" command="echo $CATALINA_HOME; export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32;killall java;service cloud-management stop;cd /opt/cloudstack/incubator-cloudstack;ant deploycddb -Drhost=${host}"/>
|
||||
</target>
|
||||
|
||||
<target name="deploycddb" description="deploy specific db configuration for clouddev" depends="deploydb">
|
||||
<exec dir="${db.scripts.dir}" executable="bash">
|
||||
<arg value="deploy-db-clouddev.sh" />
|
||||
<arg value="${host}" />
|
||||
<arg value="8443" />
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="rdebug-suspend" >
|
||||
<echo message="ant debug-suspend"/>
|
||||
<sshexec host="${host}" port="${port}" username="root" password="password" command="killall java;service cloud-management stop;sleep 1;echo $CATALINA_HOME; export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32;cd /opt/cloudstack/incubator-cloudstack;ant deploy-server;ant debug-suspend"/>
|
||||
</target>
|
||||
|
||||
<target name="rdebug">
|
||||
<echo message="ant debug"/>
|
||||
<sshexec trust="yes" host="${host}" port="${port}" username="root" password="password" command="killall java;service cloud-management stop;sleep 1;export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32;cd /opt/cloudstack/incubator-cloudstack;ant deploy-server; ant debug "/>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="rdeploy" description="deploy to remote">
|
||||
<condition property="zip.uptodate">
|
||||
<available file="${deploy.work.dir}/client.zip" type="file"/>
|
||||
</condition>
|
||||
|
||||
|
||||
|
||||
<echo message="copying build folder to remote"/>
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/cloudstack/incubator-cloudstack/build">
|
||||
<fileset dir="build">
|
||||
</fileset>
|
||||
</scp>
|
||||
|
||||
<scp trust="yes" port="${port}" file="build.xml" todir="root:password@${host}:/opt/cloudstack/incubator-cloudstack/">
|
||||
</scp>
|
||||
|
||||
<echo message="copying deps folder to remote"/>
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/cloudstack/incubator-cloudstack/deps">
|
||||
<fileset dir="deps">
|
||||
</fileset>
|
||||
</scp>
|
||||
|
||||
<echo message="copying target folder to remote"/>
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/cloudstack/incubator-cloudstack/target">
|
||||
<fileset dir="target">
|
||||
</fileset>
|
||||
</scp>
|
||||
|
||||
<echo message="copying dist folder to remote"/>
|
||||
<scp trust="yes" port="${port}" todir="root:password@${host}:/opt/cloudstack/incubator-cloudstack/dist">
|
||||
<fileset dir="dist">
|
||||
</fileset>
|
||||
</scp>
|
||||
|
||||
<sshexec trust="yes" host="${host}" port="${port}" username="root" password="password" command="echo $CATALINA_HOME; export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32;cd /opt/cloudstack/incubator-cloudstack;ant deploy-server"/>
|
||||
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@ -1,82 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="Cloud Stack Document Tasks" default="help" basedir=".">
|
||||
<description>
|
||||
Cloud Stack ant build file
|
||||
</description>
|
||||
|
||||
<!--
|
||||
Always use this variable to refer to the base directory because this
|
||||
variable is changeable
|
||||
-->
|
||||
<dirname property="base.dir" file="${ant.file.Cloud Stack Document Tasks}/.." />
|
||||
|
||||
<import file="./build-cloud.xml" optional="false"/>
|
||||
|
||||
<!-- directories for java doc -->
|
||||
<property name="docs.dir" location="${target.dir}/docs" />
|
||||
<property name="docs.dist.dir" location="${dist.dir}/docs" />
|
||||
|
||||
<target name="doc" depends="-init, javadoc, readme" description="create all javadoc" />
|
||||
|
||||
<target name="readme" depends="-init">
|
||||
<mkdir dir="${docs.dir}/readme" />
|
||||
<copy file="${agent.dir}/scripts/README.txt" todir="${docs.dir}/readme" />
|
||||
</target>
|
||||
|
||||
<target name="pdf" depends="-init">
|
||||
<javadoc doclet="com.tarsec.javadoc.pdfdoclet.PDFDoclet" docletpath="${tools.dir}/pdfdoclet/pdfdoclet-1.0.2-all.jar" overview="${build.dir}/overview.html" additionalparam="-pdf javadoc.pdf -debug" private="no" access="public" classpathref="deps.classpath" linksource="true" sourcepathref="prod.src.path">
|
||||
<!--
|
||||
<taglet name="net.sourceforge.taglets.Taglets" path="${tools.dir}/taglets/taglets.jar"/>
|
||||
<tag name="config" description="Configurable Parameters in components.xml" scope="types"/>
|
||||
<tag name="see" />
|
||||
<tag name="author" />
|
||||
<tag name="since" />
|
||||
-->
|
||||
<!--<packages>com.cloud.agent</packages-->
|
||||
<!--package name="com.cloud.agent"/-->
|
||||
<packageset dir="${server.dir}/src" />
|
||||
</javadoc>
|
||||
</target>
|
||||
|
||||
<target name="javadoc" depends="-init, build-all" description="Generate internal javadoc documentation for maintenance">
|
||||
<!-- documentation properties -->
|
||||
<property name="jdoc.footer" value="Copyright &copy; ${company.copyright.year} ${company.name}" />
|
||||
|
||||
<javadoc destdir="${docs.dir}/html/api-internal" author="true" version="true" classpathref="deps.classpath" sourcepathref="prod.src.path" access="protected" linksource="true" windowtitle="${company.name} ${version} Maintenance API Reference" doctitle="${company.name} ${version} Maintenance API Reference" bottom="${jdoc.footer}" overview="${build.dir}/overview.html">
|
||||
<excludepackage name="com.xensource.xenapi.*" />
|
||||
<taglet name="net.sourceforge.taglets.Taglets" path="${tools.dir}/taglets/taglets.jar" />
|
||||
<tag name="config" description="Configurable Parameters in components.xml" scope="types" />
|
||||
<tag name="see" />
|
||||
<tag name="author" />
|
||||
<tag name="since" />
|
||||
<packageset dir="${server.dir}/src" />
|
||||
</javadoc>
|
||||
</target>
|
||||
|
||||
<target name="build-docs" depends="javadoc">
|
||||
<copy todir="${docs.dist.dir}">
|
||||
<fileset dir="${docs.dir}" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
||||
|
||||
@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="Marvin TestClient" default="help" basedir=".">
|
||||
<description>
|
||||
This build file contains simple targets that
|
||||
- build
|
||||
- package
|
||||
- distribute
|
||||
the Marvin test client written in python
|
||||
</description>
|
||||
|
||||
<dirname property="base.dir" file="${ant.file.Cloud Stack}/.." />
|
||||
<property name="build.dir" location="${base.dir}/build" />
|
||||
|
||||
<import file="${build.dir}/build-cloud.xml" optional="false" />
|
||||
<import file="${build.dir}/developer.xml" optional="false" />
|
||||
|
||||
<!-- directories for the test client code compilation-->
|
||||
<property name="dist.dir" location="${base.dir}/dist" />
|
||||
<property name="marvin.dir" location="${base.dir}/tools/marvin" />
|
||||
<property name="marvin.dist.dir" location="${base.dir}/tools/marvin/dist" />
|
||||
<property name="marvin.src.dir" location="${base.dir}/tools/marvin/marvin" />
|
||||
|
||||
<target name="build-marvin" depends="build-apidocs" description="generates the cloudstackAPIs for marvin">
|
||||
<echo message="Generating Marvin API Classes"/>
|
||||
<exec dir="${marvin.src.dir}" executable="python" failonerror="true">
|
||||
<arg value="codegenerator.py" />
|
||||
<arg value="-s" />
|
||||
<arg value="${dist.dir}/commands.xml" />
|
||||
</exec>
|
||||
<echo message="API classes @ ${marvin.src.dir}/cloudstackAPI"/>
|
||||
</target>
|
||||
|
||||
<target name="package-marvin" depends="build-marvin" description="create a distributable tarball of Marvin">
|
||||
<echo message="Packaging Marvin"/>
|
||||
<exec dir="${marvin.dir}" executable="python" failonerror="true">
|
||||
<arg value="setup.py" />
|
||||
<arg value="sdist" />
|
||||
</exec>
|
||||
<echo message="distributable tarball at: ${marvin.dist.dir}/Marvin-*.tar.gz"/>
|
||||
</target>
|
||||
|
||||
<target name="install-marvin" depends="package-marvin" description="installs marvin on the local machine">
|
||||
<echo message="Uninstalling Marvin" />
|
||||
<exec dir="${marvin.dist.dir}" executable="pip">
|
||||
<arg line="uninstall -y marvin"/>
|
||||
</exec>
|
||||
<echo message="Installing Marvin" />
|
||||
<exec dir="${marvin.dist.dir}" executable="pip">
|
||||
<arg value="install" />
|
||||
<arg value="Marvin-0.1.0.tar.gz" />
|
||||
</exec>
|
||||
</target>
|
||||
</project>
|
||||
@ -1,319 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="Cloud Stack Tests" default="help" basedir=".">
|
||||
<description>
|
||||
Cloud Stack ant build file
|
||||
</description>
|
||||
|
||||
<!--
|
||||
Always use this variable to refer to the base directory because this
|
||||
variable is changeable
|
||||
-->
|
||||
<dirname property="base.dir" file="${ant.file.Cloud Stack Tests}/.." />
|
||||
<property name="build.dir" location="${base.dir}/build" />
|
||||
|
||||
<import file="${build.dir}/build-cloud.xml" optional="false" />
|
||||
|
||||
<property name="server.test.dir" location="${server.dir}/test" />
|
||||
<property name="core.test.dir" location="${core.dir}/test/" />
|
||||
<property name="agent.test.dir" location="${utils.dir}/test/" />
|
||||
<!-- directories for agent simulator code compilation-->
|
||||
<property name="agent-simulator.dir" location="${base.dir}/agent-simulator" />
|
||||
<property name="agent-simulator.dist.dir" location="${dist.dir}/agent-simulator" />
|
||||
|
||||
<!-- directories for the test client code compilation-->
|
||||
<property name="testclient.dir" location="${base.dir}/test" />
|
||||
<property name="testclient.dist.dir" location="${dist.dir}/test" />
|
||||
<property name="tools.dist.dir" location="${dist.dir}/cloudapitools" />
|
||||
|
||||
<property name="test.target.dir" location="${target.dir}/test" />
|
||||
<property name="test.classes.dir" location="${test.target.dir}/classes"/>
|
||||
|
||||
<property name="agent-simulator.jar" value="cloud-agent-simulator.jar" />
|
||||
<property name="testclient.jar" value="cloud-test.jar" />
|
||||
|
||||
<property name="simulator.setup.dir" value="${base.dir}/setup/db/" />
|
||||
<property name="marvin.sandbox.dir" value="${base.dir}/tools/marvin/marvin/sandbox/" />
|
||||
<property name="marvin.config" value="${base.dir}/tools/marvin/marvin/sandbox/demo/simulator/simulator.cfg" />
|
||||
<property name="marvin.config.abspath" location="${marvin.config}" />
|
||||
|
||||
<!-- =================== Agent Simulator ==================== -->
|
||||
<path id="agent-simulator.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath" />
|
||||
</path>
|
||||
<target name="compile-agent-simulator" depends="-init, compile-api, compile-utils, compile-core, compile-agent, compile-server" description="Compile the agent simulator.">
|
||||
<compile-java jar.name="${agent-simulator.jar}" top.dir="${agent-simulator.dir}" classpath="agent-simulator.classpath" />
|
||||
<copy overwrite="true" todir="${server.dist.dir}/conf">
|
||||
<fileset dir="${agent-simulator.dir}/tomcatconf">
|
||||
<include name="*.in" />
|
||||
</fileset>
|
||||
<globmapper from="*.in" to="*" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="build-agent-simulator" depends="-init, compile-agent-simulator">
|
||||
<mkdir dir="${agent-simulator.dist.dir}" />
|
||||
<mkdir dir="${agent-simulator.dist.dir}/conf" />
|
||||
<mkdir dir="${agent-simulator.dist.dir}/logs" />
|
||||
|
||||
<copy todir="${agent-simulator.dist.dir}">
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="${agent-simulator.jar}" />
|
||||
<include name="${agent.jar}" />
|
||||
<include name="${utils.jar}" />
|
||||
<include name="${core.jar}" />
|
||||
<include name="${api.jar}" />
|
||||
</fileset>
|
||||
<fileset dir="${deps.dir}">
|
||||
<include name="log4j-1.2.15.jar" />
|
||||
<include name="gson-1.3.jar" />
|
||||
<include name="commons-logging-1.1.1.jar" />
|
||||
<include name="commons-collections-3.2.1.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${server.dist.dir}/conf">
|
||||
<fileset dir="${agent-simulator.dir}/tomcatconf">
|
||||
<include name="*.in" />
|
||||
</fileset>
|
||||
<globmapper from="*.in" to="*" />
|
||||
</copy>
|
||||
<copy todir="${agent-simulator.dist.dir}/conf">
|
||||
<fileset dir="${agent.dir}/conf">
|
||||
<include name="log4j-cloud.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
<!-- =================== Agent Simulator ==================== -->
|
||||
|
||||
<!-- Run Simulator Tests -->
|
||||
<target name="setup-simulator" depends="clean-all">
|
||||
<mkdir dir="${simulator.setup.dir}/override">
|
||||
</mkdir>
|
||||
<copy overwrite="true" file="${simulator.setup.dir}/templates.simulator.sql" tofile="${simulator.setup.dir}/override/templates.sql" />
|
||||
|
||||
<mkdir dir="${build.dir}/override">
|
||||
</mkdir>
|
||||
<copy overwrite="true" file="${build.dir}/replace.properties" tofile="${build.dir}/override/replace.properties" />
|
||||
<!-- Replace the COMPONENT-SPEC for components-simulator.xml -->
|
||||
<copy overwrite="true" file="${build.dir}/simulator.properties" tofile="${build.dir}/override/replace.properties" />
|
||||
</target>
|
||||
|
||||
<target name="run-simulator" depends="setup-simulator, build-all-with-simulator, deploy-server, deploydb-simulator, debug">
|
||||
</target>
|
||||
|
||||
<target name="run-marvin" depends="install-marvin">
|
||||
<exec dir="${marvin.sandbox.dir}/" executable="bash">
|
||||
<arg line="run-marvin.sh -d localhost -m localhost -c ${marvin.config.abspath}" />
|
||||
</exec>
|
||||
</target>
|
||||
<!-- -->
|
||||
|
||||
<!-- =================== QA Testing Client ==================== -->
|
||||
<target name="-init-test" depends="-init">
|
||||
<mkdir dir="${test.target.dir}" />
|
||||
<mkdir dir="${test.classes.dir}" />
|
||||
</target>
|
||||
|
||||
<path id="testclient.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath" />
|
||||
</path>
|
||||
<target name="compile-testclient" depends="-init-test, compile-utils" description="Compile the test client.">
|
||||
<echo message="src is ${testclient.dir}"/>
|
||||
<compile-java jar.name="${testclient.jar}" top.dir="${testclient.dir}" classpath="testclient.classpath" />
|
||||
</target>
|
||||
|
||||
<target name="build-testclient" depends="-init-test, compile-testclient">
|
||||
<mkdir dir="${testclient.dist.dir}/src" />
|
||||
<mkdir dir="${testclient.dist.dir}/conf" />
|
||||
<mkdir dir="${testclient.dist.dir}/metadata" />
|
||||
<mkdir dir="${testclient.dist.dir}/usage" />
|
||||
|
||||
<copy todir="${testclient.dist.dir}/src">
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="${testclient.jar}" />
|
||||
<include name="${utils.jar}" />
|
||||
</fileset>
|
||||
<fileset dir="${deps.dir}">
|
||||
<include name="commons-httpclient-3.1.jar" />
|
||||
<include name="commons-logging-1.1.1.jar" />
|
||||
<include name="commons-codec-1.4.jar" />
|
||||
<include name="log4j.jar" />
|
||||
<include name="log4j-extras.jar" />
|
||||
<include name="trilead-ssh2-build213.jar" />
|
||||
<include name="mysql-connector-java-5.1.7-bin.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${testclient.dist.dir}/conf">
|
||||
<fileset dir="${testclient.dir}/conf">
|
||||
<include name="log4j.properties" />
|
||||
<include name="templates.sql" />
|
||||
<include name="deploy.xml" />
|
||||
<include name="config.xml" />
|
||||
<include name="tool.properties" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy overwrite="true" todir="${testclient.dist.dir}/scripts">
|
||||
<fileset dir="${testclient.dir}/scripts" />
|
||||
</copy>
|
||||
|
||||
<copy overwrite="true" todir="${testclient.dist.dir}/metadata">
|
||||
<fileset dir="${testclient.dir}/metadata" />
|
||||
</copy>
|
||||
|
||||
<copy todir="${testclient.dist.dir}/usage" overwrite="true">
|
||||
<fileset dir="${testclient.dir}/scripts/usage" />
|
||||
</copy>
|
||||
|
||||
<copy overwrite="true" todir="${testclient.dist.dir}">
|
||||
<fileset dir="${testclient.dir}/conf/">
|
||||
<include name="deploy.properties" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<chmod file="${testclient.dist.dir}/scripts/deploy.sh" perm="uog+xr" />
|
||||
<chmod file="${testclient.dist.dir}/scripts/cleanup.sh" perm="uog+xr" />
|
||||
<chmod file="${testclient.dist.dir}/scripts/cleanparallel.sh" perm="uog+xr" />
|
||||
<chmod file="${testclient.dist.dir}/scripts/deploycluster.sh" perm="uog+xr" />
|
||||
|
||||
</target>
|
||||
|
||||
|
||||
<target name="build-tools" depends="-init-test, compile-testclient">
|
||||
<mkdir dir="${tools.dist.dir}/src" />
|
||||
<mkdir dir="${tools.dist.dir}/conf" />
|
||||
|
||||
|
||||
<copy todir="${tools.dist.dir}/src">
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="${testclient.jar}" />
|
||||
<include name="${utils.jar}" />
|
||||
</fileset>
|
||||
<fileset dir="${deps.dir}">
|
||||
<include name="commons-httpclient-3.1.jar" />
|
||||
<include name="commons-logging-1.1.1.jar" />
|
||||
<include name="commons-codec-1.4.jar" />
|
||||
<include name="log4j-1.2.15.jar" />
|
||||
<include name="apache-log4j-extras-1.0.jar" />
|
||||
<include name="trilead-ssh2-build213.jar" />
|
||||
<include name="mysql-connector-java-5.1.7-bin.jar" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy overwrite="true" todir="${tools.dist.dir}/conf">
|
||||
<fileset dir="${testclient.dir}/conf">
|
||||
<include name="tool.properties" />
|
||||
<include name="log4j.properties" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy overwrite="true" todir="${tools.dist.dir}">
|
||||
<fileset dir="${testclient.dir}/scripts" >
|
||||
<include name="certSubmitEC2.sh" />
|
||||
<include name="certDeleteEC2.sh" />
|
||||
<include name="sign.sh" />
|
||||
</fileset>
|
||||
<fileset dir="${testclient.dir}/conf">
|
||||
<include name="README" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<chmod file="${tools.dist.dir}/certSubmitEC2.sh" perm="a+xr" />
|
||||
<chmod file="${tools.dist.dir}/certDeleteEC2.sh" perm="a+xr" />
|
||||
<chmod file="${tools.dist.dir}/sign.sh" perm="a+xr" />
|
||||
</target>
|
||||
|
||||
<target name="-clean-test">
|
||||
<delete dir="${test.classes.dir}" />
|
||||
<delete dir="${test.target.dir}" />
|
||||
</target>
|
||||
<!-- =================== QA Testing Client ==================== -->
|
||||
|
||||
<!-- ============== Server Testing =============== -->
|
||||
<target name="compile-server-test" depends="-init-test, compile-server" description="Compile all the source code in the server directory">
|
||||
<property name="server.test.target.dir" location="${test.classes.dir}/server" />
|
||||
<property name="jarname" value="server-test.jar" />
|
||||
|
||||
<mkdir dir="${server.test.target.dir}" />
|
||||
|
||||
<depend srcdir="${server.test.dir}" destdir="${server.test.target.dir}" cache="${dep.cache.dir}">
|
||||
</depend>
|
||||
<javac srcdir="${server.test.dir}" debug="${debug}" debuglevel="${debuglevel}" deprecation="${deprecation}" source="1.5" target="1.5" destdir="${server.test.target.dir}" includeantruntime="false">
|
||||
<classpath refid="deps.classpath" />
|
||||
<classpath refid="test.classpath" />
|
||||
<compilerarg value="-Xlint:all" />
|
||||
</javac>
|
||||
<jar jarfile="${test.target.dir}/${jarname}" basedir="${server.test.target.dir}">
|
||||
<metainf dir="${server.dir}/metadata">
|
||||
<include name="**/*.xml" />
|
||||
</metainf>
|
||||
<manifest>
|
||||
<attribute name="Class-Path" value="" />
|
||||
<attribute name="Built-By" value="${built.by}" />
|
||||
<section name="com/cloud/">
|
||||
<attribute name="Specification-Title" value="Cloud Stack" />
|
||||
<attribute name="Specification-Version" value="${version}" />
|
||||
<attribute name="Specification-Vendor" value="${company.name}" />
|
||||
<attribute name="Implementation-Title" value="Server" />
|
||||
<attribute name="Implementation-Version" value="${impl.version}" />
|
||||
<attribute name="Implementation-Vendor" value="${company.name}" />
|
||||
</section>
|
||||
</manifest>
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<!-- ====================== XMLTEST Python Based testing ================== -->
|
||||
<target name="xmltest-translate" description="Translate an XML test file into Python">
|
||||
<echo message="Translating: ${xmltest}"/>
|
||||
<exec dir="tools/testClient" executable="python">
|
||||
<arg line="translator.py -i ${xmltest}"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="xmltest-execute" description="Specify XML test file with -Dxmltest=filename" depends="xmltest-translate">
|
||||
<echo message="Executing: ${xmltest}.py"/>
|
||||
<exec dir="tools/testClient" executable="python">
|
||||
<arg line="${xmltest}.py"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="xmltest-automated" description="Used to run the daily tests using tools/testClient/automated.xml as the source of tests">
|
||||
<property name="xmltest" value="automated/automated.xml"/>
|
||||
<echo message="Running daily test run with ${xmltest}.py"/>
|
||||
<antcall target="xmltest-execute"/>
|
||||
</target>
|
||||
|
||||
<target name="automated-test-run" description="Run the automated tests in tools/testClient/testcases/automated.xml using the debug server">
|
||||
<antcall target="build-all"/>
|
||||
<antcall target="deploy-server"/>
|
||||
<antcall target="deploydb"/>
|
||||
<antcall target="start-tomcat"/>
|
||||
<echo message="running tests..."/>
|
||||
<antcall target="xmltest-automated"/>
|
||||
<antcall target="stop-tomcat"/>
|
||||
<antcall target="clean-tomcat"/>
|
||||
</target>
|
||||
<!-- ====================== XMLTEST Python Based testing ================== -->
|
||||
|
||||
</project>
|
||||
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="Cloud Stack Usage Server" default="help" basedir=".">
|
||||
<description>
|
||||
Cloud Stack Usage server build
|
||||
</description>
|
||||
<property name="base.dir" location="${ant.file.Cloud Stack Usage Server}/../../.."/>
|
||||
<property name="oss.build.dir" location="${base.dir}/build"/>
|
||||
<property name="usage.jar" value="cloud-usage.jar" />
|
||||
<dirname property="proprietary.dir" file="${ant.file.Cloud Stack Usage Server}/../"/>
|
||||
|
||||
<import file="${oss.build.dir}/build-cloud.xml" optional="false"/>
|
||||
<property name="usage.dir" location="${base.dir}/usage" />
|
||||
<property name="usage.dist.dir" location="${dist.dir}/usage" />
|
||||
<!-- ToDo: get actual PID -->
|
||||
<property name="pid" value="4567"/>
|
||||
|
||||
<!-- ===================== Usage.Jar ===================== -->
|
||||
<path id="usage.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath" />
|
||||
</path>
|
||||
<target name="compile-usage" depends="-init, compile-utils, compile-core, compile-server" description="Compile the usage server">
|
||||
<compile-java jar.name="${usage.jar}" top.dir="${usage.dir}" classpath="usage.classpath" />
|
||||
</target>
|
||||
|
||||
<target name="build-usage" depends="compile-usage">
|
||||
<mkdir dir="${usage.dist.dir}/conf" />
|
||||
|
||||
<copy overwrite="true" todir="${usage.dist.dir}/lib">
|
||||
<fileset dir="${jar.dir}">
|
||||
<include name="${usage.jar}" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="run-usage" depends="build-usage, deploy-usage">
|
||||
<java classname="com.cloud.usage.UsageServer" fork="true">
|
||||
<classpath refid="usage.classpath"/>
|
||||
<jvmarg value="-Dpid=${pid}"/>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="debug-usage" depends="build-usage, deploy-usage">
|
||||
<java classname="com.cloud.usage.UsageServer" fork="true">
|
||||
<classpath refid="usage.classpath"/>
|
||||
<jvmarg value="-Dpid=${pid}"/>
|
||||
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8788,server=y,suspend=n"/>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@ -1,29 +0,0 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
|
||||
# major.minor.patch versioning scheme for CloudStack
|
||||
company.major.version=4
|
||||
company.minor.version=0
|
||||
company.patch.version=0
|
||||
|
||||
svn.revision=2
|
||||
|
||||
# copyright year
|
||||
company.copyright.year=2012
|
||||
company.url=http://cloudstack.org
|
||||
company.license.name=Apache License, Version 2.0
|
||||
company.name=CloudStack
|
||||
@ -1,431 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="CloudStack Developer Targets" basedir=".">
|
||||
<description>
|
||||
This is a developer.xml with tools to start and stop tomcat and
|
||||
generally developer targets that has nothing to do with compiling.
|
||||
</description>
|
||||
|
||||
<dirname property="base.dir" file="${ant.file.CloudStack Developer Targets}/.."/>
|
||||
<property name="build.dir" location="${base.dir}/build"/>
|
||||
|
||||
<property name="tomcat.home" location="${env.CATALINA_HOME}"/>
|
||||
<property name="assertion" value="-ea"/>
|
||||
|
||||
<property name="dist.dir" location="${base.dir}/dist"/>
|
||||
<property name="deploy.work.dir" location="${dist.dir}"/>
|
||||
<property name="server.deploy.to.dir" location="${tomcat.home}"/>
|
||||
<property name="unittest.dir" location="${base.dir}/unittest"/>
|
||||
<property name="unittest.target.dir" location="${unittest.dir}/classes"/>
|
||||
<property name="unittest.jar.dir" location="${unittest.dir}/jar"/>
|
||||
<property name="unittest.formatter" value="plain" />
|
||||
<property name="ovm.dir" location="${base.dir}/ovm" />
|
||||
<property name="usage.dir" location="${base.dir}/usage" />
|
||||
|
||||
<!-- directories for api doc -->
|
||||
<property name="api.docs.dir" location="${dist.dir}/apidocs" />
|
||||
|
||||
<condition property="jmxport" value="${jmxport.override}" else="45219">
|
||||
<isset property="jmxport.override" />
|
||||
</condition>
|
||||
|
||||
<macrodef name="compile-test">
|
||||
<attribute name="top.dir" description="Top Directory of the source. We will add src to this to get the source code."/>
|
||||
<attribute name="jar.name" description="Name of the jar file"/>
|
||||
<attribute name="classpath" description="class path to use"/>
|
||||
<element name="include-files" optional="true"/>
|
||||
<element name="exclude-files" optional="true"/>
|
||||
|
||||
<sequential>
|
||||
<mkdir dir="${unittest.target.dir}/@{jar.name}"/>
|
||||
|
||||
<depend srcdir="@{top.dir}/test" destdir="${unittest.target.dir}/@{jar.name}" cache="${dep.cache.dir}" />
|
||||
|
||||
<echo message="Compiling @{top.dir}/test"/>
|
||||
<javac srcdir="@{top.dir}/test" debug="${debug}" debuglevel="${debuglevel}" deprecation="${deprecation}" destdir="${unittest.target.dir}/@{jar.name}" source="${source.compat.version}" target="${target.compat.version}" includeantruntime="false" compiler="javac1.6">
|
||||
<compilerarg line="-Xlint:-path"/>
|
||||
<classpath refid="@{classpath}" />
|
||||
<exclude-files/>
|
||||
</javac>
|
||||
<jar jarfile="${unittest.jar.dir}/@{jar.name}" basedir="${unittest.target.dir}/@{jar.name}" update="true"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
|
||||
<target name="clean-edits" description="Delete all the editor backup files in the source tree.">
|
||||
<delete>
|
||||
<fileset dir="${base.dir}" includes="**/*~" />
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="run" depends="start-tomcat"/>
|
||||
<target name="stop" depends="stop-tomcat"/>
|
||||
<target name="debug" depends="debug-tomcat"/>
|
||||
|
||||
<target name="setup">
|
||||
<mkdir dir="${build.dir}/override"/>
|
||||
<copy todir="${build.dir}/override">
|
||||
<fileset dir="${build.dir}">
|
||||
<include name="build-cloud.properties"/>
|
||||
<include name="replace.properties"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<loadproperties srcfile="${build.dir}/override/replace.properties" resource="propertyresource"/>
|
||||
<!-- propertyfile file="${build.dir}/override/replace.properties"/ -->
|
||||
</target>
|
||||
|
||||
<target name="debug-suspend">
|
||||
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
|
||||
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
|
||||
<jvmarg value="-Dcom.sun.management.jmxremote.port=${jmxport}"/>
|
||||
<jvmarg value="-Dcom.sun.management.jmxremote.authenticate=false"/>
|
||||
<jvmarg value="-Dcom.sun.management.jmxremote.ssl=false"/>
|
||||
<jvmarg value="-Xdebug"/>
|
||||
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
|
||||
<jvmarg value="-ea"/>
|
||||
<jvmarg value="-Xms256m"/>
|
||||
<jvmarg value="-Xmx384m"/>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="stop-tomcat">
|
||||
<java dir="${tomcat.home}/bin/" jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
|
||||
<arg value="stop"/>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="start-tomcat" depends="stop-tomcat">
|
||||
<echo message="Start Tomcat" />
|
||||
<java dir="${tomcat.home}/bin/" jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
|
||||
<jvmarg value="${assertion}"/>
|
||||
<jvmarg value="-Dcom.sun.management.jmxremote.port=${jmxport}"/>
|
||||
<jvmarg value="-Dcom.sun.management.jmxremote.authenticate=false"/>
|
||||
<jvmarg value="-Dcom.sun.management.jmxremote.ssl=false"/>
|
||||
<jvmarg value="-Xms256m"/>
|
||||
<jvmarg value="-Xmx512m"/>
|
||||
<jvmarg value="-XX:MaxPermSize=128m"/>
|
||||
<jvmarg value="-ea"/>
|
||||
<arg value="start"/>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="debug-tomcat">
|
||||
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="true">
|
||||
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
|
||||
<jvmarg value="-Dcom.sun.management.jmxremote.port=${jmxport}"/>
|
||||
<jvmarg value="-Dcom.sun.management.jmxremote.authenticate=false"/>
|
||||
<jvmarg value="-Dcom.sun.management.jmxremote.ssl=false"/>
|
||||
<jvmarg value="-Xdebug"/>
|
||||
<jvmarg value="${debug.jvmarg}"/>
|
||||
<jvmarg value="-ea"/>
|
||||
<jvmarg value="-Xms256m"/>
|
||||
<jvmarg value="-Xmx512m"/>
|
||||
<jvmarg value="-XX:MaxPermSize=128m"/>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="clean-tomcat" depends="stop-tomcat,clean-awsapi-tomcat">
|
||||
<delete dir="${tomcat.home}/webapps/client"/>
|
||||
<delete dir="${tomcat.home}/webapps/awsapi" />
|
||||
<delete dir="${tomcat.home}/webapps7080/awsapi" />
|
||||
<delete dir="${tomcat.home}/work/Catalina"/>
|
||||
<delete dir="${tomcat.home}/temp" />
|
||||
<delete dir="${tomcat.home}/logs" />
|
||||
<delete quiet="false" >
|
||||
<fileset dir="${tomcat.home}/conf" >
|
||||
<include name="**/*component*.xml" />
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="unzip" if="zip.uptodate">
|
||||
<unzip src="${deploy.work.dir}/client.zip" dest="${deploy.work.dir}/client"/>
|
||||
</target>
|
||||
|
||||
<target name="unzip-usage" if="usagezip.uptodate">
|
||||
<unzip src="${deploy.work.dir}/usage.zip" dest="${deploy.work.dir}/usage"/>
|
||||
</target>
|
||||
|
||||
<target name="deploy-ovm" >
|
||||
<ant antfile="${base.dir}/plugins/hypervisors/ovm/build.xml" target="deploy-ovm"/>
|
||||
</target>
|
||||
|
||||
<target name="deploy-server" depends="deploy-common, deploy-ovm, deploy-awsapi" >
|
||||
<copy todir="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/vms" file="${dist.dir}/systemvm.iso" />
|
||||
</target>
|
||||
|
||||
<target name="deploy-server-encrypt" depends="deploy-server" >
|
||||
<move file="${server.deploy.to.dir}/conf/db-enc.properties" tofile="${server.deploy.to.dir}/conf/db.properties" overwrite="true"/>
|
||||
<echo file="/etc/cloud/management/key" append="false">password</echo>
|
||||
</target>
|
||||
|
||||
<target name="deploy-common" >
|
||||
<condition property="zip.uptodate">
|
||||
<available file="${deploy.work.dir}/client.zip" type="file"/>
|
||||
</condition>
|
||||
<antcall target="unzip" inheritAll="true"/>
|
||||
<unwar overwrite="true" src="${deploy.work.dir}/client/client.war" dest="${server.deploy.to.dir}/webapps/client"/>
|
||||
<copy todir="${server.deploy.to.dir}/lib">
|
||||
<fileset dir="${deps.dir}/">
|
||||
<include name="*.jar"/>
|
||||
<exclude name="servlet*.jar"/>
|
||||
<exclude name="axis2*.jar"/>
|
||||
<exclude name="*slf4j*.jar"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<touch file="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/scripts/vm/hypervisor/xenserver/version"/>
|
||||
<echo file="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/scripts/vm/hypervisor/xenserver/version" append="false" message="${version}.${build.number}"/>
|
||||
<copy overwrite="true" todir="${server.deploy.to.dir}/conf">
|
||||
<fileset dir="${deploy.work.dir}/client/conf/">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<chmod perm="755">
|
||||
<fileset dir="${server.deploy.to.dir}/webapps/client/WEB-INF/lib">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</chmod>
|
||||
|
||||
|
||||
<!-- <copy overwrite="true" todir="${server.deploy.to.dir}/lib" file="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/cloud-mysql-connector-java-5.1.7-bin.jar" />
|
||||
<delete file="${server.deploy.to.dir}/webapps/client/WEB-INF/lib/cloud-mysql-connector-java-5.1.7-bin.jar" />
|
||||
-->
|
||||
<replace file="${server.deploy.to.dir}/conf/catalina.properties" summary="true">
|
||||
<replacetoken><![CDATA[shared.loader=
|
||||
]]></replacetoken>
|
||||
<replacevalue><![CDATA[shared.loader=${catalina.home},${catalina.home}/conf
|
||||
]]></replacevalue> </replace>
|
||||
</target>
|
||||
|
||||
<target name="deploy-usage">
|
||||
<condition property="usagezip.uptodate">
|
||||
<available file="${deploy.work.dir}/usage.zip" type="file" />
|
||||
</condition>
|
||||
<antcall target="unzip-usage" inheritAll="true" />
|
||||
<copy overwrite="true" todir="${server.deploy.to.dir}/conf">
|
||||
<fileset dir="${usage.dir}/conf/">
|
||||
<include name="*.in" />
|
||||
</fileset>
|
||||
<globmapper from="*.in" to="*" />
|
||||
</copy>
|
||||
<copy overwrite="true" todir="${server.deploy.to.dir}/webapps/client/WEB-INF/lib">
|
||||
<fileset dir="${deploy.work.dir}/usage/lib/">
|
||||
<include name="**/*.jar"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="deploy-cloudstack-db">
|
||||
<condition property="server-setup.file" value="override/server-setup.xml" else="server-setup.xml">
|
||||
<available file="${setup.db.dir}/override/server-setup.xml" />
|
||||
</condition>
|
||||
|
||||
<condition property="templates.file" value="override/templates.sql" else="templates.sql" >
|
||||
<available file="${setup.db.dir}/override/templates.sql" />
|
||||
</condition>
|
||||
|
||||
<echo message="${db.scripts.dir}\\deploy-db-dev.sh ${server-setup.file} ${templates.file} ${DBROOTPW}" />
|
||||
<exec dir="${db.scripts.dir}" executable="bash" failonerror="true">
|
||||
<arg value="deploy-db-dev.sh" />
|
||||
<arg value="${server-setup.file}" />
|
||||
<arg value="${templates.file}" />
|
||||
<arg value="${DBROOTPW}" />
|
||||
<env key="CATALINA_HOME" value="${tomcat.home}"/>
|
||||
</exec>
|
||||
|
||||
<chmod perm="666">
|
||||
<fileset dir="${db.scripts.dir}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</chmod>
|
||||
</target>
|
||||
|
||||
<target name="deploydb" depends="deploy-cloudstack-db, deploy-awsapi-db">
|
||||
</target>
|
||||
|
||||
<target name="deploydb-simulator">
|
||||
<condition property="server-setup.file" value="${setup.db.dir}/override/server-setup.xml" else="server-setup.xml">
|
||||
<available file="${setup.db.dir}/override/server-setup.xml" />
|
||||
</condition>
|
||||
|
||||
<condition property="templates.file" value="${setup.db.dir}/override/templates.sql" else="templates.sql" >
|
||||
<available file="${setup.db.dir}/override/templates.sql" />
|
||||
</condition>
|
||||
|
||||
<echo message="deploydb ${server-setup.file} ${templates.file} ${DBROOTPW}" />
|
||||
<exec dir="${db.scripts.dir}" executable="bash" failonerror="true">
|
||||
<arg value="deploy-db-simulator.sh" />
|
||||
<arg value="${server-setup.file}" />
|
||||
<arg value="${templates.file}" />
|
||||
<arg value="${DBROOTPW}" />
|
||||
<env key="CATALINA_HOME" value="${tomcat.home}"/>
|
||||
</exec>
|
||||
|
||||
<chmod perm="666">
|
||||
<fileset dir="${db.scripts.dir}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</chmod>
|
||||
</target>
|
||||
|
||||
<path id="test.classpath">
|
||||
<path refid="deps.classpath" />
|
||||
<path refid="dist.classpath"/>
|
||||
<!-- external deps, added for jenkins
|
||||
depends on mysql-connector-java rpm
|
||||
-->
|
||||
<fileset dir="/usr/share/java/" erroronmissingdir="true">
|
||||
<include name="mysql-connector-java.jar" />
|
||||
</fileset>
|
||||
<fileset dir="${unittest.jar.dir}">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
<fileset dir="${deps.dir}">
|
||||
<include name="junit-*.jar"/>
|
||||
</fileset>
|
||||
<dirset dir="${utils.test.dir}/resources"/>
|
||||
<dirset dir="${server.test.dir}/resources"/>
|
||||
<dirset dir="${base.dir}/setup/db"/>
|
||||
</path>
|
||||
|
||||
<target name="compile-tests" depends="compile-all">
|
||||
<mkdir dir="${unittest.dir}"/>
|
||||
<mkdir dir="${unittest.target.dir}"/>
|
||||
<mkdir dir="${unittest.jar.dir}"/>
|
||||
|
||||
<compile-test jar.name="utils-test.jar" top.dir="${utils.dir}" classpath="test.classpath"/>
|
||||
<compile-test jar.name="server-test.jar" top.dir="${server.dir}" classpath="test.classpath"/>
|
||||
</target>
|
||||
|
||||
<target name="unittest" description="Execute unit tests" depends="compile-tests">
|
||||
<junit fork="true" printsummary="true" showoutput="true" failureproperty="junit.failure">
|
||||
<!-- N.b. use failureproperty instead of haltonfailure, because if we use
|
||||
the former, we will get no detailed report about the failure.
|
||||
If the test fails, the fail element below will still assure that
|
||||
the Ant run will exit with error status.
|
||||
-->
|
||||
<!--bootclasspath refid="test.classpath"/-->
|
||||
<classpath refid="test.classpath"/>
|
||||
<jvmarg value="${debug.jvmarg}"/>
|
||||
<batchtest todir="${unittest.dir}">
|
||||
<formatter type="${unittest.formatter}"/>
|
||||
<fileset dir="${utils.test.dir}">
|
||||
<include name="**/*Test.java"/>
|
||||
</fileset>
|
||||
<fileset dir="${server.test.dir}">
|
||||
<include name="**/*Test.java"/>
|
||||
<exclude name="**/upgrade/*.java"/>
|
||||
</fileset>
|
||||
</batchtest>
|
||||
</junit>
|
||||
<junitreport todir="${unittest.dir}">
|
||||
<fileset dir="${unittest.dir}"/>
|
||||
<report todir="${unittest.dir}/test-reports"/>
|
||||
</junitreport>
|
||||
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/>
|
||||
</target>
|
||||
|
||||
<target name="test" description="Execute one unit test" depends="compile-tests">
|
||||
<junit fork="true" printsummary="true" showoutput="true" failureproperty="junit.failure">
|
||||
<!-- N.b. use failureproperty instead of haltonfailure, because if we use
|
||||
the former, we will get no detailed report about the failure.
|
||||
If the test fails, the fail element below will still assure that
|
||||
the Ant run will exit with error status.
|
||||
-->
|
||||
<classpath refid="test.classpath"/>
|
||||
<jvmarg value="${debug.jvmarg}"/>
|
||||
<jvmarg value="-ea"/>
|
||||
<jvmarg value="-Xms1024m"/>
|
||||
<jvmarg value="-Xmx1024m"/>
|
||||
<batchtest todir="${unittest.dir}">
|
||||
<formatter type="${unittest.formatter}"/>
|
||||
<fileset dir="${utils.test.dir}">
|
||||
<include name="**/${test}.java"/>
|
||||
</fileset>
|
||||
<fileset dir="${server.test.dir}">
|
||||
<include name="**/${test}.java"/>
|
||||
<exclude name="**/upgrade/*.java"/>
|
||||
</fileset>
|
||||
</batchtest>
|
||||
</junit>
|
||||
<junitreport todir="${unittest.dir}">
|
||||
<fileset dir="${unittest.dir}"/>
|
||||
<report todir="${unittest.dir}/test-reports"/>
|
||||
</junitreport>
|
||||
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/>
|
||||
</target>
|
||||
|
||||
<target name="test-suspend" description="Execute one unit test" depends="compile-tests">
|
||||
<junit fork="true" printsummary="true" showoutput="true" failureproperty="junit.failure">
|
||||
<!-- N.b. use failureproperty instead of haltonfailure, because if we use
|
||||
the former, we will get no detailed report about the failure.
|
||||
If the test fails, the fail element below will still assure that
|
||||
the Ant run will exit with error status.
|
||||
-->
|
||||
<classpath refid="test.classpath"/>
|
||||
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
|
||||
<jvmarg value="${assertion}"/>
|
||||
<batchtest todir="${unittest.dir}">
|
||||
<formatter type="${unittest.formatter}"/>
|
||||
<fileset dir="${utils.test.dir}">
|
||||
<include name="**/${test}.java"/>
|
||||
</fileset>
|
||||
<fileset dir="${server.test.dir}">
|
||||
<include name="**/${test}.java"/>
|
||||
</fileset>
|
||||
</batchtest>
|
||||
</junit>
|
||||
<junitreport todir="${unittest.dir}">
|
||||
<fileset dir="${unittest.dir}"/>
|
||||
<report todir="${unittest.dir}/test-reports"/>
|
||||
</junitreport>
|
||||
<fail if="junit.failure" message="Unit test(s) failed. See reports!"/>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="build-apidocs" description="Generate api documentation" depends="build-all">
|
||||
<property name="commands.file" location="${dist.dir}/client/conf/commands.properties" />
|
||||
<property name="commands.ext.file" location="${dist.dir}/client/conf/commands-ext.properties" />
|
||||
<property name="commands.vr.file" location="${dist.dir}/client/conf/virtualrouter_commands.properties" />
|
||||
<property name="commands.niciranvp.file" location="${dist.dir}/client/conf/nicira-nvp_commands.properties" />
|
||||
|
||||
<echo message="build-apidocs" />
|
||||
<exec dir="${apidoc.scripts.dir}" executable="bash" failonerror="true">
|
||||
<arg value="build-apidoc.sh" />
|
||||
<arg value="${target.dir}/jar" />
|
||||
<arg value="${deps.dir}" />
|
||||
<arg value="${dist.dir}" />
|
||||
<arg value="-f ${commands.file},${commands.ext.file},${commands.vr.file},${commands.niciranvp.file}" />
|
||||
</exec>
|
||||
<echo message="Result locates at ${dist.dir}/commands.xml" />
|
||||
|
||||
<chmod perm="666">
|
||||
<fileset dir="${apidoc.scripts.dir}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</chmod>
|
||||
</target>
|
||||
|
||||
<target name="build-apidocs-zip" depends="build-apidocs">
|
||||
<delete file="${dist.dir}/apidocs-${version}.zip" />
|
||||
<zip destfile="${dist.dir}/apidocs-${version}.zip" basedir="${dist.dir}/xmldoc/html" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@ -1,35 +0,0 @@
|
||||
<html>
|
||||
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you 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.
|
||||
-->
|
||||
|
||||
<head><title></title></head>
|
||||
<body>
|
||||
|
||||
<p>
|
||||
|
||||
VMOps source javadoc.
|
||||
|
||||
<p>
|
||||
<a href="../api-test/index.html" target="_top">Javadoc for JUnit tests</a>
|
||||
is also available.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,305 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You 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 name="Cloud Stack Package" basedir=".">
|
||||
<description>
|
||||
This is a package.xml with tools to package the cloud stack distribution
|
||||
</description>
|
||||
|
||||
<dirname property="base.dir" file="${ant.file.Cloud Stack Package}/.." />
|
||||
<property name="build.dir" location="${base.dir}/build" />
|
||||
|
||||
<import file="${build.dir}/build-cloud.xml" optional="false"/>
|
||||
|
||||
<property name="target.dir" location="${base.dir}/target"/>
|
||||
<property name="scripts.target.dir" location="${target.dir}/scripts"/>
|
||||
|
||||
<property name="dist.dir" location="${base.dir}/dist" />
|
||||
<property name="publish.dir" location="${dist.dir}" />
|
||||
<property name="client.dist.dir" location="${dist.dir}/client" />
|
||||
<property name="server.dist.dir" location="${dist.dir}/client" />
|
||||
<property name="agent.dist.dir" location="${dist.dir}/agent" />
|
||||
<property name="docs.dist.dir" location="${dist.dir}/docs" />
|
||||
<property name="db.dist.dir" location="${dist.dir}/db" />
|
||||
<property name="usage.dist.dir" location="${dist.dir}/usage" />
|
||||
|
||||
<condition property="mkisofs" value="${mkisofs.override}" else="mkisofs">
|
||||
<isset property="mkisofs.override" />
|
||||
</condition>
|
||||
|
||||
<target name="-init-package">
|
||||
<mkdir dir="${dist.dir}" />
|
||||
<mkdir dir="${publish.dir}" />
|
||||
</target>
|
||||
|
||||
<target name="package-server" depends="-init-package">
|
||||
<delete file="${dist.dir}/client.zip" />
|
||||
<zip destfile="${dist.dir}/client.zip" basedir="${server.dist.dir}" />
|
||||
</target>
|
||||
|
||||
<target name="package-client" depends="-init-package">
|
||||
<zip destfile="${dist.dir}/client.zip" basedir="${client.dist.dir}">
|
||||
<zipfileset dir="${client.dist.dir}">
|
||||
<exclude name="**/*.sh" />
|
||||
</zipfileset>
|
||||
<zipfileset dir="${client.dist.dir}" filemode="555">
|
||||
<include name="**/*.sh" />
|
||||
</zipfileset>
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="package-usage" depends="-init-package">
|
||||
<zip destfile="${dist.dir}/usage.zip" basedir="${usage.dist.dir}" />
|
||||
</target>
|
||||
|
||||
<target name="package-agent-common" depends="-init-package">
|
||||
<zip destfile="${dist.dir}/agent.zip" duplicate="preserve">
|
||||
<zipfileset dir="${deps.dir}">
|
||||
<include name="cloud-xmlrpc-client-3.1.3.jar" />
|
||||
<include name="cloud-xmlrpc-common-3.1.3.jar" />
|
||||
<include name="cloud-ws-commons-util-1.0.2.jar" />
|
||||
<include name="cloud-log4j.jar" />
|
||||
<include name="cloud-apache-log4j-extras-1.0.jar" />
|
||||
<include name="cloud-gson.jar" />
|
||||
<include name="cloud-commons-httpclient-3.1.jar" />
|
||||
<include name="cloud-commons-logging-1.1.1.jar" />
|
||||
<include name="cloud-commons-collections-3.2.1.jar" />
|
||||
<include name="cloud-commons-codec-1.4.jar" />
|
||||
<include name="cloud-commons-pool-1.4.jar" />
|
||||
<include name="cloud-jna.jar" />
|
||||
<include name="cloud-cglib.jar" />
|
||||
<include name="jetty-6.1.26.jar" />
|
||||
<include name="jetty-util-6.1.26.jar"/>
|
||||
</zipfileset>
|
||||
<zipfileset dir="${jar.dir}">
|
||||
<include name="${agent.jar}" />
|
||||
<include name="${utils.jar}" />
|
||||
<include name="${core.jar}" />
|
||||
<include name="${api.jar}" />
|
||||
<include name="${kvm.jar}" />
|
||||
</zipfileset>
|
||||
|
||||
<zipfileset dir="${agent.dist.dir}" filemode="770">
|
||||
<include name="run.sh" />
|
||||
<include name="agent.sh" />
|
||||
</zipfileset>
|
||||
<zipfileset dir="${agent.dist.dir}">
|
||||
<exclude name="run.sh/" />
|
||||
<exclude name="agent.sh" />
|
||||
<include name="**/*" />
|
||||
</zipfileset>
|
||||
<zipfileset dir="${scripts.dir}" prefix="scripts" filemode="555">
|
||||
<exclude name="**/.project" />
|
||||
<exclude name="**/.classpath" />
|
||||
</zipfileset>
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="package-agent" depends="-init-package, package-oss-systemvm, build-systemvm-patch, package-agent-common, build-kvm">
|
||||
<zip destfile="${dist.dir}/agent.zip" duplicate="preserve" update="true">
|
||||
<zipfileset dir="${dist.dir}" prefix="vms">
|
||||
<include name="patch.tgz" />
|
||||
</zipfileset>
|
||||
<zipfileset dir="${dist.dir}" prefix="vms" filemode="555">
|
||||
<include name="systemvm.zip" />
|
||||
</zipfileset>
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="package-oss-systemvm-iso" depends="-init-package, package-oss-systemvm, update-oss-systemvm-with-vmware, build-systemvm-patch">
|
||||
<exec executable="${mkisofs}" dir="${dist.dir}">
|
||||
<arg value="-quiet"/>
|
||||
<arg value="-r"/>
|
||||
<arg value="-o"/>
|
||||
<arg value="systemvm.iso"/>
|
||||
<arg value="systemvm.zip"/>
|
||||
<arg value="cloud-scripts.tgz"/>
|
||||
<arg value="authorized_keys"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="package-agent-simulator" depends="-init-package">
|
||||
<delete file="${dist.dir}/agent-simulator.zip" />
|
||||
<zip destfile="${dist.dir}/agent-simulator.zip" duplicate="preserve">
|
||||
<zipfileset dir="${agent-simulator.dist.dir}">
|
||||
<exclude name="**/*.sh" />
|
||||
<exclude name="**/vnetd" />
|
||||
<exclude name="**/send_arp" />
|
||||
<exclude name="**/vn" />
|
||||
<exclude name="**/*.exp" />
|
||||
</zipfileset>
|
||||
<zipfileset dir="${agent-simulator.dist.dir}" filemode="555">
|
||||
<include name="**/*.sh" />
|
||||
<include name="**/vnetd" />
|
||||
<include name="**/send_arp" />
|
||||
<include name="**/vn" />
|
||||
<include name="**/*.exp" />
|
||||
</zipfileset>
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<!-- <target name="build-all" depends="build-opensource, build-plugins, build-ui, build-war-oss, compile-testclient, compile-usage, build-awsapi"> -->
|
||||
<target name="build-all" depends="build-opensource, build-plugins, build-ui, build-war-oss, compile-usage, build-awsapi">
|
||||
</target>
|
||||
|
||||
<target name="build-all-with-simulator" depends="build-all, compile-agent-simulator">
|
||||
<war destfile="${client.dist.dir}/client.war" webxml="${client.dir}/WEB-INF/web.xml" update="true">
|
||||
<lib dir="${jar.dir}">
|
||||
<include name="cloud-*.jar" />
|
||||
<include name="vmware-*.jar" />
|
||||
<exclude name="cloud-servlet-api.jar"/>
|
||||
</lib>
|
||||
</war>
|
||||
</target>
|
||||
|
||||
<target name="build-war-oss" depends="-init-package" description="Compile the GWT client UI and builds WAR file.">
|
||||
<mkdir dir="${client.dist.dir}" />
|
||||
|
||||
<war destfile="${client.dist.dir}/client.war" webxml="${client.dir}/WEB-INF/web.xml" update="true">
|
||||
<fileset dir="${client.target.dir}">
|
||||
<include name="**/*" />
|
||||
<exclude name="**/*.properties" />
|
||||
</fileset>
|
||||
<classes dir="${client.target.dir}">
|
||||
<include name="**/resources/*.properties" />
|
||||
</classes>
|
||||
<lib dir="${jar.dir}">
|
||||
<include name="cloud-*.jar" />
|
||||
<include name="vmware-*.jar" />
|
||||
<exclude name="cloud-servlet-api.jar"/>
|
||||
</lib>
|
||||
<zipfileset dir="${scripts.target.dir}" prefix="WEB-INF/lib/scripts" filemode="555">
|
||||
<include name="**/*" />
|
||||
</zipfileset>
|
||||
<zipfileset dir="${db.scripts.dir}" prefix="WEB-INF/lib/db" filemode="555">
|
||||
<include name="**/*"/>
|
||||
</zipfileset>
|
||||
</war>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="package-oss-systemvm" depends="-init-package">
|
||||
<zip destfile="${dist.dir}/systemvm.zip" duplicate="preserve" update="true">
|
||||
<!-- Console proxy now includes an agent shell, therefore we need to package agent related distribution -->
|
||||
<zipfileset dir="${deps.dir}">
|
||||
<include name="xmlrpc-client-3.1.3.jar" />
|
||||
<include name="xmlrpc-common-3.1.3.jar" />
|
||||
<include name="ws-commons-util-1.0.2.jar" />
|
||||
<include name="log4j*.jar" />
|
||||
<include name="asm-3.1.jar" />
|
||||
<include name="apache-log4j-extras-1.1.jar" />
|
||||
<include name="gson-1.7.1.jar" />
|
||||
<include name="commons-httpclient-3.1.jar" />
|
||||
<include name="commons-logging-1.1.1.jar" />
|
||||
<include name="commons-collections-3.1.jar" />
|
||||
<include name="commons-codec-1.6.jar" />
|
||||
<include name="commons-pool-1.6.jar" />
|
||||
<include name="cglib-*.jar" />
|
||||
<include name="axis-*.jar" />
|
||||
<include name="discovery-*.jar" />
|
||||
<include name="wsdl4j-*.jar" />
|
||||
<include name="ejb-api-3.0.jar" />
|
||||
<include name="aws-java-sdk-1.3.21.1.jar" />
|
||||
<include name="httpclient-4.1.jar" />
|
||||
<include name="httpcore-4.1.jar" />
|
||||
<include name="commons-lang-2.1.jar" />
|
||||
</zipfileset>
|
||||
<zipfileset dir="${jar.dir}">
|
||||
<include name="${agent.jar}" />
|
||||
<include name="${utils.jar}" />
|
||||
<include name="${core.jar}" />
|
||||
<include name="${api.jar}" />
|
||||
</zipfileset>
|
||||
<zipfileset dir="${console-proxy.dist.dir}" filemode="555"/>
|
||||
<zipfileset dir="${scripts.dir}/storage/secondary" prefix="scripts/storage/secondary" filemode="555">
|
||||
<exclude name="**/.project" />
|
||||
<exclude name="**/.classpath" />
|
||||
</zipfileset>
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="update-oss-systemvm-with-vmware" depends="-init-package" if="ssvm.include.vmware.jar">
|
||||
<zip destfile="${dist.dir}/systemvm.zip" duplicate="preserve" update="true">
|
||||
<zipfileset dir="${jar.dir}" >
|
||||
<include name="${vmware.jar}" />
|
||||
<include name="${vmware-base.jar}" />
|
||||
</zipfileset>
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="package-docs" depends="-init-package">
|
||||
<delete file="${dist.dir}/docs.zip" />
|
||||
<zip destfile="${dist.dir}/docs.zip" compress="false">
|
||||
<fileset dir="${docs.dist.dir}" />
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="package-test" depends="-init-package">
|
||||
<delete file="${publish.dir}/test.zip" />
|
||||
<zip destfile="${publish.dir}/test.zip" compress="false">
|
||||
<zipfileset dir="${testclient.dist.dir}" filemode="555" />
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="package-tools" depends="-init-package">
|
||||
<delete file="${publish.dir}/cloudapitools.zip" />
|
||||
<zip destfile="${publish.dir}/cloudapitools.zip" compress="false">
|
||||
<zipfileset dir="${tools.dist.dir}" filemode="555" />
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="clean-packages">
|
||||
<delete>
|
||||
<fileset dir="${dist.dir}" includes="*.zip" />
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="package-all" depends="package-client, package-agent, package-agent-simulator, package-usage, package-docs">
|
||||
<tstamp>
|
||||
<format property="package.date" pattern="yyyy-MM-dd" />
|
||||
</tstamp>
|
||||
</target>
|
||||
|
||||
<target name="package-kvm" depends="package-agent">
|
||||
<zip destfile="${dist.dir}/agent.zip" update="true">
|
||||
<zipfileset dir="${jar.dir}">
|
||||
<include name="cloud-plugin-hypervisor-kvm.jar"/>
|
||||
</zipfileset>
|
||||
<zipfileset dir="${deps.dir}">
|
||||
<include name="libvirt-0.4.8.jar"/>
|
||||
</zipfileset>
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="clean-zip">
|
||||
<delete dir="${dist.dir}">
|
||||
<include name="*.zip" />
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<!-- The following target is OBSOLETE. If you need to add a jar file / target, go to the function def runant(target): in wscrpit_build, and list the jar file and the target in the appropriate places -->
|
||||
<target name="sendjarfiles" depends="compile-utils, compile-core, compile-server, compile-agent">
|
||||
<copy todir="${waf.artifacts}">
|
||||
<fileset dir="${target.dir}/jar"/>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@ -1,328 +0,0 @@
|
||||
********************************************************************************
|
||||
VMOps Cloud Stack Version 0.4
|
||||
Release Notes
|
||||
********************************************************************************
|
||||
|
||||
=================================
|
||||
WHAT'S NEW :
|
||||
=================================
|
||||
|
||||
* NIC bonding support for the Computing, Routing, and Storage nodes to take
|
||||
advantage of the multiple NICS installed on the server.
|
||||
* Maintenance Mode support for physical servers. Administrators now have the
|
||||
option to enable or disable maintenance mode on any physical servers. Enabling
|
||||
maintenance mode on a Routing or Computing node will result in the seamless live
|
||||
migration of guest virtual machines into other physical servers within the same
|
||||
zone before making the server available for maintenance.
|
||||
* Introduction of a new user web interface for allowing user accounts to manage
|
||||
their own virtual machines. This new interface has a brand new look and feel,
|
||||
allows for easier branding and customization, and is easier to incorporate into
|
||||
existing web interfaces.
|
||||
* Added support for the creation of Reseller Domains. The Reseller Domain
|
||||
feature allows host providers to create resellers complete with their own
|
||||
user base and administrators while using the same global computing resources
|
||||
provided by the host provider.
|
||||
* Added a new email alerting system that will now inform administrators of
|
||||
events such as when physical servers are down or computing resources are
|
||||
passing a pre-configured threshold.
|
||||
* Massive improvements to the existing Developer and Integration API. Error
|
||||
codes have now been added and existing API method names and parameters have been
|
||||
made more consistent. A JSON format can also now be optionally
|
||||
returned in addition to the existing XML format. Please read the new API
|
||||
Reference documentation for more details on the changes.
|
||||
* Billing records have now been changed to Usage records to provide data for
|
||||
both billing integration and usage metering. Price has been completely removed
|
||||
from VMOps. Instead we added ability to set your own display text for both
|
||||
service offering and templates. You can now use this to set any text for the UI
|
||||
to display.
|
||||
* New virtual machines deployed will now generate a random password. A reset
|
||||
password is also now available both in the web user interface as well as the
|
||||
API. We support both Linux and Windows OS based templates.
|
||||
* Storage server is now a bare-bone installation and uses the new COMSTAR iSCSI
|
||||
stack for improved performance. We recognized that while running the storage
|
||||
server as a virtual machine does allows for more hardware support, it severely
|
||||
impacts performance. The list of compatible hardware can be found in the Open
|
||||
Solaris website.
|
||||
* Added clustering support for the VMOps Management Server.
|
||||
* Added the ability to configure an additional storage ip address (separate
|
||||
subnet) for both Routing and Computing servers. If a server is configured with
|
||||
an additional storage ip, all storage traffic will route through this subnet and
|
||||
all network/internet traffic will route through the existing private network.
|
||||
* Added concept of a user account. VMOps supports multiple username for a
|
||||
single user account.
|
||||
* Created new installers for the VMOps MultiTenant Hypervisor and the VMOps
|
||||
Storage.
|
||||
|
||||
=================================
|
||||
KNOWN ISSUES :
|
||||
=================================
|
||||
|
||||
* DomR is still counting internal network activities as part of the usage that
|
||||
is being returned by the API.
|
||||
* The reset password for virtual machine feature does not return an error if it
|
||||
fails to successfully reset the password.
|
||||
* VMOps installation scripts to not validate bad network configuration values.
|
||||
* VNX Proxy Server does not handle rapid refreshes of web console proxy well.
|
||||
* VNC Proxy Server at times do not return a thumbnail image.
|
||||
* Rebooting a DomR instance will cause network traffic to not be collected.
|
||||
* Associating new IP addresses should clean out existing LB or PF rules before
|
||||
assigning it to a DomR instance.
|
||||
* The Usage parse engine needs to be split out from the VMOps Management Server
|
||||
so that only a single instance of this can be running and does not affect
|
||||
normal operations.
|
||||
* Templates needs a way of specifying the minimum CPU and Memory requirements.
|
||||
* createUser API method currently allows you to assign users to admin accounts.
|
||||
* Installations of servers with more than 3 NIC sometimes duplicates the MAC
|
||||
address on the ifcfg configuration files.
|
||||
* Additional admin only API methods are missing (ie. Domain management, router
|
||||
management).
|
||||
* Usage parse engine could go OOM in the event it has not been run recently
|
||||
and there are a large (2 million+ records).
|
||||
* Problem with domU when both e1000 and e1000e used as a NIC drivers for a
|
||||
Computing Server. The installer needs to blacklist one of the drivers.
|
||||
* vnet failures and xen crashes currently do not generate an alert to the administrator.
|
||||
* The current limit for domU instances created on a Computing Server is 64 and
|
||||
the currently limit for domR instances created is 59 on a Routing Server.
|
||||
* No current way of allowing different subnets for different pods within the
|
||||
same zone.
|
||||
* limit the number of usage and event records returned by the API. A large
|
||||
enough of the query could cause the Management Server to go oom.
|
||||
|
||||
=================================
|
||||
BUG FIXES :
|
||||
=================================
|
||||
|
||||
* Improved transactions across both database calls and calls across agents.
|
||||
* Fixed an issue where duplicate IP or LB rules could be sent to the DomR
|
||||
instance during a DomR restart.
|
||||
* Removed requirement of the reverse DNS lookup for the Storage Server.
|
||||
* Massive improvements to the HA process.
|
||||
* Fixed an issue where the it would take too long for the management server
|
||||
to detect a TCP disconnect.
|
||||
* Fixed an issue where the the agent would *think* it has connected to the
|
||||
management server but in reality, it is just stuck waiting for a response that
|
||||
will never come.
|
||||
* Generic DB lock wait timeout fixes.
|
||||
* Improvements to the general state management of the servers.
|
||||
* Fixed issue where where physical servers with the same IP attempts to connect
|
||||
to the Management Server. The second server is now prevented from registering.
|
||||
* Fixed an issue where deleting a user from an account would result in all the
|
||||
virtual machines to be cleaned up. This can only happen if the last user for
|
||||
an account has been deleted.
|
||||
* Fixed an issue where the source NAT ip address of a DomR instance is being
|
||||
released back into the public pool even though the DomR instance was not
|
||||
successfully destroyed.
|
||||
* Fixed an issue where a guest virtual machine cannot be destroyed while in HA
|
||||
state.
|
||||
* Removed requirement to specify the storage type when installing a new tempate.
|
||||
* Fixed an issue where the console proxy from different zones are all starting
|
||||
in the same zone.
|
||||
* Fixed an issue where the listing of virtual machines would hang if the console
|
||||
proxy is not even started.
|
||||
* Massive improvements to our installer scripts.
|
||||
* Massive improvements to the general stability of the Cloud Stack.
|
||||
* Fixed an issue where the Hypervisor installer is unable to install onto
|
||||
machines with a IPMI card.
|
||||
* As usual, there are too many bug fixes to list...
|
||||
|
||||
********************************************************************************
|
||||
VMOps Cloud Stack Version 0.3.xxxx
|
||||
Release Notes
|
||||
********************************************************************************
|
||||
|
||||
=================================
|
||||
WHAT'S NEW :
|
||||
=================================
|
||||
|
||||
* Introduction of VMOps Developer API. This allows users of the VMOps Cloud
|
||||
Stack to manage their virtual machines through a set of REST-like API.
|
||||
* Improved collection of user usage data that can be used for both billing
|
||||
aggregation and metric collection.
|
||||
* High availability support for user virtual machines.
|
||||
* Support for automatic hypervisor agent software update.
|
||||
* VNC console proxy servers can now run as managed VMOps system VMs. The new
|
||||
implementation provides features such as on-demand VM startup, standby
|
||||
capacity pre-allocation and console proxy load monitoring.
|
||||
* Much Improved VMOps Cloud Stack installation process. VMOps Cloud Stack can
|
||||
now be installed with a minimum of two physical servers.
|
||||
* VMOps Cloud Stack installation DVD now comes in two flavors. VMOps Cloud Stack
|
||||
Management Server Installation DVD and VMOps Cloud Stack Multitenant
|
||||
Hypervisor Installation DVD.
|
||||
|
||||
=================================
|
||||
KNOWN ISSUES :
|
||||
=================================
|
||||
|
||||
* PV drivers for Windows 2003 and Windows 2003 x86_64 (Incomplete Feature)
|
||||
* GUI panel for allowing administrators to set various system configurations -
|
||||
i.e. zones, pods, ip addresses (Incomplete Feature)
|
||||
* Support for multiple NIC cards on computing, routing, and storage servers
|
||||
(Disabled Feature)
|
||||
* Support for resellers (Incomplete Feature)
|
||||
* Allow admins/users to specify the root password for their new instance. It
|
||||
cannot default to root/password (Bug 134)
|
||||
* Admin/User Dashboard (Bug 154 and 155)
|
||||
* Dynamically refresh server and vm instance status in GUI without a manual
|
||||
refresh (Bug 389)
|
||||
* Need transaction semantics across DB and agent. Without this, it is possible
|
||||
to timeout db calls that first lock a record and relies on an agent response
|
||||
before releasing that record. (Bug 408)
|
||||
* All Server Roles (Mgmt, Computing, Routing, and Storage) require a functioning
|
||||
eth0 NIC in order to install correctly. (Bug 470)
|
||||
* Unable to handle HA when an entire Pod is unreachable (Bug 620)
|
||||
* Improved network traffic reporting (Bug 642)
|
||||
* Multiple login support a single user account (Bug 589)
|
||||
* DomR instances continue to run even though all VMs associated with the DomR
|
||||
are no longer even running. (Bug 617)
|
||||
* HA fails when VM and Router for the same user go down at the same time
|
||||
(Bug 603)
|
||||
|
||||
=================================
|
||||
BUG FIXES :
|
||||
=================================
|
||||
|
||||
* Improved Billing data generation (Bug 482)
|
||||
* Able to create new admins through the admin console UI. (Bug 492)
|
||||
* Able to create new Service Offerings through the admin console UI (Bug 500)
|
||||
* Significantly improved the imaging speed when installing VMOps Cloud Stack
|
||||
(Bug 476)
|
||||
* Harden DomR Template to prevent unauthorized access
|
||||
* No longer require eth0 during installation process of the hosts (Bug 490)
|
||||
* Fixed issue where having multiple NIC cards caused issues (Bug 489)
|
||||
* Installation UI will now allow you to select to the disk for storage
|
||||
(Bug 556)
|
||||
* Installation UI will now allow you to select NIC to use as private, public,
|
||||
or simply disabled
|
||||
* Mgmt server will now reflect the status of user vms if the storage server that
|
||||
hosts the vm's volumes is no longer accessible. (Bug 521)
|
||||
* Routing and Console Proxy VM will now be HA-enabled by default (Bug 614)
|
||||
* Console Proxy VM are now automatically managed by the Mgmt Server (Bug 110)
|
||||
* Template Management from the console admin UI should be improved
|
||||
* Too many to list...
|
||||
|
||||
********************************************************************************
|
||||
VMOps Cloud Stack Version 0.2.6297
|
||||
Release Notes
|
||||
********************************************************************************
|
||||
|
||||
=================================
|
||||
WHAT'S NEW :
|
||||
=================================
|
||||
|
||||
* VMOps Server
|
||||
- Introduction of VMOps Integration API. This API allows service providers
|
||||
to provision users and to retrieve billing info and events. It is a simple
|
||||
query language written on top of HTTP that simply returns results in XML
|
||||
format.
|
||||
- Improved VMOps Server installation process.
|
||||
|
||||
* VMOps Multitenant Hypervisor
|
||||
- Improved VMOps Multitenant Hypervisor installation process.
|
||||
|
||||
=================================
|
||||
KNOWN ISSUES :
|
||||
=================================
|
||||
|
||||
* PV drivers for Windows 2003 and Windows 2003 x86_64 (Incomplete Feature)
|
||||
* Developer, Billing, and Provisioning API (Incomplete Feature)
|
||||
* Mirroring of disk images on storage servers across pods (Incomplete Feature)
|
||||
* HA Enabled VMs (Disabled Feature)
|
||||
* Firewall integration API (Incomplete Feature)
|
||||
* GUI panel for allowing administrators to set various system configurations -
|
||||
i.e. zones, pods, ip addresses (Incomplete Feature)
|
||||
* Support for multiple NIC cards on computing, routing, and storage servers
|
||||
(Disabled Feature)
|
||||
* Ability to deploy agent upgrade on VMOps server and have the upgrade
|
||||
automatically propagated to storage, routing, and computing servers.
|
||||
(Bug 386)
|
||||
* Detailed IO stats for storage servers (Bug 94)
|
||||
* Admin/User Dashboard (Bug 154 and 155)
|
||||
* OpenSolaris kernel panic (Bug 413)
|
||||
* Dynamically refresh server and vm instance status in GUI without a manual
|
||||
refresh (Bug 389)
|
||||
* Need transaction semantics across DB and agent. Without this, it is possible
|
||||
to timeout db calls that first lock a record and relies on an agent response
|
||||
before releasing that record. (Bug 408)
|
||||
* All Server Roles (Mgmt, Computing, Routing, and Storage) require a functioning
|
||||
eth0 NIC in order to install correctly. (Bug 470)
|
||||
* Admin Console UI Templates Tab needs improvement. (Bug 469)
|
||||
* Unable to create new admins through the admin console UI. (Bug 492)
|
||||
* Unable to create new Service Offerings through the admin console UI (Bug 500)
|
||||
|
||||
=================================
|
||||
BUG FIXES :
|
||||
=================================
|
||||
|
||||
* Added a new XML (server-setup.xml) to configure initial VMOps Server data.
|
||||
(Bug 430)
|
||||
* Made installation of the router template easier (Bug 434)
|
||||
* Deleting a user through the admin UI will now show a progress bar (Bug 428)
|
||||
* You can no longer any drop down boxes in the search left panel of the console
|
||||
UI (Bug 439)
|
||||
* Configured dom0 and domR to no longer do any reverse DNS lookup (Bug 459)
|
||||
* Fixed installer to handle multiple NIC (Bug 457)
|
||||
* Missing SDL module in all templates (Bug 449)
|
||||
|
||||
********************************************************************************
|
||||
VMOps Cloud Stack Version 0.1.6053
|
||||
Release Notes
|
||||
********************************************************************************
|
||||
|
||||
=================================
|
||||
WHAT'S NEW :
|
||||
=================================
|
||||
|
||||
* VMOps Server
|
||||
- Complete web UI for both administrators and users to manage VMOps Cloud
|
||||
Stack.
|
||||
- Allows administrators to manage the creation of service offerings and set
|
||||
its pricing along with pricing for network bandwidth, additional public
|
||||
ips, and vm templates.
|
||||
- Allows administrators to retrieve billing records and user usages.
|
||||
- VM Sync - coordinates, manages, and maintains the life cycle of VMOps agents
|
||||
running on attached computing, routing, and storage hosts.
|
||||
- VM Template Management - allows administrators to manage and upload hosted
|
||||
vm templates into VMOps Cloud Stack.
|
||||
|
||||
* VMOps Multitenant Hypervisor
|
||||
- Designed to allow for the complete isolation of CPU, memory, storage, and
|
||||
network resources for each user.
|
||||
• Hypervisor Attached Storage (HAS) – The storage solution that is
|
||||
integrated within the hypervisor and does not rely on centralized SAN or NAS
|
||||
to implement storage virtualization. It provides a high performance and
|
||||
ultra-reliable block storage for virtual machine images
|
||||
- Hypervisor Aware Network (HAN) – The network solution for VMOps Cloud Stack
|
||||
that implements the necessary IP address translation and tunneling for the
|
||||
guest OS running inside the virtual machine. It does not rely on VLAN to
|
||||
implement any network virtualization and isolation.
|
||||
|
||||
=================================
|
||||
KNOWN ISSUES :
|
||||
=================================
|
||||
|
||||
* PV drivers for Windows 2003 and Windows 2003 x86_64 (Incomplete Feature)
|
||||
* Developer, Billing, and Provisioning API (Incomplete Feature)
|
||||
* Mirroring of disk images on storage servers across pods (Incomplete Feature)
|
||||
* HA Enabled VMs (Disabled Feature)
|
||||
* Firewall integration API (Incomplete Feature)
|
||||
* GUI panel for allowing administrators to set various system configurations -
|
||||
i.e. zones, pods, ip addresses (Incomplete Feature)
|
||||
* Support for multiple NIC cards on computing, routing, and storage servers
|
||||
(Disabled Feature)
|
||||
* Ability to deploy agent upgrade on VMOps server and have the upgrade
|
||||
automatically propagated to storage, routing, and computing servers.
|
||||
(Bug 386)
|
||||
* Detailed IO stats for storage servers (Bug 94)
|
||||
* Admin/User Dashboard (Bug 154 and 155)
|
||||
* OpenSolaris kernel panic (Bug 413)
|
||||
* Dynamically refresh server and vm instance status in GUI without a manual
|
||||
refresh (Bug 389)
|
||||
* Need transaction semantics across DB and agent. Without this, it is possible
|
||||
to timeout db calls that first lock a record and relies on an agent response
|
||||
before releasing that record. (Bug 408)
|
||||
|
||||
=================================
|
||||
BUG FIXES :
|
||||
=================================
|
||||
|
||||
* N/A
|
||||
647
cloud.spec
647
cloud.spec
@ -1,647 +0,0 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
|
||||
%define __os_install_post %{nil}
|
||||
%global debug_package %{nil}
|
||||
|
||||
# DISABLE the post-percentinstall java repacking and line number stripping
|
||||
# we need to find a way to just disable the java repacking and line number stripping, but not the autodeps
|
||||
|
||||
Name: cloud
|
||||
Summary: CloudStack IaaS Platform
|
||||
Version: %{_ver}
|
||||
#http://fedoraproject.org/wiki/PackageNamingGuidelines#Pre-Release_packages
|
||||
%if "%{?_prerelease}" != ""
|
||||
Release: 0.%{_build_number}%{dist}.%{_prerelease}
|
||||
%else
|
||||
Release: %{_rel}%{dist}
|
||||
%endif
|
||||
License: Apache License 2.0
|
||||
Vendor: CloudStack <engineering@cloud.com>
|
||||
Packager: CloudStack <engineering@cloud.com>
|
||||
Group: System Environment/Libraries
|
||||
# FIXME do groups for every single one of the subpackages
|
||||
Source0: %{name}-%{_ver}.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{_ver}-%{release}-build
|
||||
|
||||
%if 0%{?fedora} >= 17
|
||||
BuildRequires: java-1.7.0-openjdk-devel
|
||||
%else
|
||||
BuildRequires: java-1.6.0-openjdk-devel
|
||||
%endif
|
||||
BuildRequires: tomcat6
|
||||
BuildRequires: ws-commons-util
|
||||
BuildRequires: jpackage-utils
|
||||
BuildRequires: gcc
|
||||
BuildRequires: glibc-devel
|
||||
BuildRequires: /usr/bin/mkisofs
|
||||
BuildRequires: MySQL-python
|
||||
|
||||
%description
|
||||
CloudStack is a highly-scalable elastic, open source,
|
||||
intelligent IaaS cloud implementation.
|
||||
|
||||
%package utils
|
||||
Summary: CloudStack utility library
|
||||
Requires: java >= 1.6.0
|
||||
Requires: python
|
||||
Group: System Environment/Libraries
|
||||
Obsoletes: vmops-utils < %{version}-%{release}
|
||||
%description utils
|
||||
Utility libraries and set of Java classes used
|
||||
by CloudStack.
|
||||
|
||||
%package client-ui
|
||||
Summary: CloudStack management server UI
|
||||
Requires: %{name}-client
|
||||
Group: System Environment/Libraries
|
||||
Obsoletes: vmops-client-ui < %{version}-%{release}
|
||||
%description client-ui
|
||||
The CloudStack management server is the central point of coordination,
|
||||
management, and intelligence in CloudStack. This package
|
||||
is a requirement of the %{name}-client package, which installs the
|
||||
CloudStack management server.
|
||||
|
||||
%package server
|
||||
Summary: CloudStack server library
|
||||
Requires: java >= 1.6.0
|
||||
Obsoletes: vmops-server < %{version}-%{release}
|
||||
Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}, %{name}-scripts = %{version}, tomcat6-servlet-2.5-api
|
||||
Group: System Environment/Libraries
|
||||
%description server
|
||||
The CloudStack server libraries provide a set of Java classes for CloudStack.
|
||||
|
||||
%package scripts
|
||||
Summary: CloudStack scripts
|
||||
# FIXME nuke the archdependency
|
||||
Requires: python
|
||||
Requires: bash
|
||||
Requires: bzip2
|
||||
Requires: gzip
|
||||
Requires: unzip
|
||||
Requires: /sbin/mount.nfs
|
||||
Requires: openssh-clients
|
||||
Requires: nfs-utils
|
||||
Requires: wget
|
||||
# there is a fsimage.so in the source code, which adds xen-libs as a dependence, needs to supress it, as rhel doesn't have this pacakge
|
||||
AutoReqProv: no
|
||||
Provides: cloud-agent-scripts = %{version}-%{release}
|
||||
Obsoletes: cloud-agent-scripts < %{version}-%{release}
|
||||
Group: System Environment/Libraries
|
||||
%description scripts
|
||||
This package contains common scripts used by the Agent and Management server
|
||||
|
||||
%package python
|
||||
Summary: CloudStack Python library
|
||||
# FIXME nuke the archdependency
|
||||
Requires: python
|
||||
Group: System Environment/Libraries
|
||||
%description python
|
||||
The CloudStack Python library contains a few Python modules that the
|
||||
CloudStack uses.
|
||||
|
||||
%package deps
|
||||
Summary: CloudStack library dependencies
|
||||
Requires: java >= 1.6.0
|
||||
Requires: mysql-connector-java
|
||||
Obsoletes: vmops-deps < %{version}-%{release}
|
||||
Group: System Environment/Libraries
|
||||
%description deps
|
||||
This package contains a number of third-party dependencies
|
||||
not shipped by distributions, required to run CloudStack
|
||||
|
||||
|
||||
%package core
|
||||
Summary: CloudStack core library
|
||||
Requires: java >= 1.6.0
|
||||
Requires: %{name}-utils = %{version}, %{name}-deps = %{version}
|
||||
Group: System Environment/Libraries
|
||||
Obsoletes: vmops-core < %{version}-%{release}
|
||||
%description core
|
||||
The CloudStack core libraries provide a set of Java classes used
|
||||
in CloudStack.
|
||||
|
||||
%package client
|
||||
Summary: CloudStack management server
|
||||
# If GCJ is present, a setPerformanceSomething method fails to load Catalina
|
||||
Conflicts: java-1.5.0-gcj-devel
|
||||
Obsoletes: vmops-client < %{version}-%{release}
|
||||
Obsoletes: cloud-premium < %{version}-%{release}
|
||||
Requires: java >= 1.6.0
|
||||
Requires: %{name}-deps = %{version}, %{name}-utils = %{version}, %{name}-server = %{version}
|
||||
Requires: %{name}-client-ui = %{version}
|
||||
Requires: %{name}-setup = %{version}
|
||||
Requires: %{name}-scripts = %{version}
|
||||
Requires: %{name}-python = %{version}
|
||||
Requires: %{name}-aws-api = %{version}
|
||||
# for consoleproxy
|
||||
# Requires: %{name}-agent
|
||||
Requires: tomcat6
|
||||
Requires: ws-commons-util
|
||||
Requires: jpackage-utils
|
||||
Requires: sudo
|
||||
Requires: /sbin/service
|
||||
Requires: /sbin/chkconfig
|
||||
Requires: /usr/bin/ssh-keygen
|
||||
Requires: mkisofs
|
||||
Requires: MySQL-python
|
||||
Requires: python-paramiko
|
||||
Requires: ipmitool
|
||||
Requires: %{name}-utils = %{version}
|
||||
%if 0%{?fedora} > 14
|
||||
Requires: apache-commons-dbcp
|
||||
Requires: apache-commons-collections
|
||||
Requires: jakarta-commons-httpclient
|
||||
Requires: jakarta-taglibs-standard
|
||||
Requires: mysql-connector-java
|
||||
%endif
|
||||
|
||||
Group: System Environment/Libraries
|
||||
%description client
|
||||
The CloudStack management server is the central point of coordination,
|
||||
management, and intelligence in CloudStack and installs the management server.
|
||||
|
||||
%package setup
|
||||
Summary: CloudStack setup tools
|
||||
Obsoletes: vmops-setup < %{version}-%{release}
|
||||
Requires: java >= 1.6.0
|
||||
Requires: python
|
||||
Requires: MySQL-python
|
||||
Requires: %{name}-utils = %{version}
|
||||
Requires: %{name}-server = %{version}
|
||||
Requires: %{name}-deps = %{version}
|
||||
Requires: %{name}-python = %{version}
|
||||
Group: System Environment/Libraries
|
||||
%description setup
|
||||
The CloudStack setup tools let you set up your Management Server and Usage Server.
|
||||
|
||||
%package agent-libs
|
||||
Summary: CloudStack agent libraries
|
||||
Requires: java >= 1.6.0
|
||||
Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}
|
||||
Requires: commons-httpclient
|
||||
Requires: jakarta-commons-logging
|
||||
Requires: jpackage-utils
|
||||
Group: System Environment/Libraries
|
||||
%description agent-libs
|
||||
The CloudStack agent libraries are used by the KVM Agent
|
||||
|
||||
%package agent
|
||||
Summary: CloudStack agent
|
||||
Obsoletes: vmops-agent < %{version}-%{release}
|
||||
Obsoletes: vmops-console < %{version}-%{release}
|
||||
Obsoletes: cloud-console < %{version}-%{release}
|
||||
Obsoletes: cloud-vnet < %{version}-%{release}
|
||||
Obsoletes: cloud-premium-agent < %{version}-%{release}
|
||||
Requires: java >= 1.6.0
|
||||
Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}
|
||||
Requires: %{name}-agent-libs = %{version}
|
||||
Requires: %{name}-scripts = %{version}
|
||||
Requires: python
|
||||
Requires: %{name}-python = %{version}
|
||||
Requires: commons-httpclient
|
||||
Requires: jakarta-commons-logging
|
||||
Requires: libvirt
|
||||
Requires: /usr/sbin/libvirtd
|
||||
Requires: jpackage-utils
|
||||
Requires: /sbin/service
|
||||
Requires: /sbin/chkconfig
|
||||
Requires: jna
|
||||
Requires: ebtables
|
||||
Requires: jsvc
|
||||
Requires: jakarta-commons-daemon
|
||||
Requires: bridge-utils
|
||||
Group: System Environment/Libraries
|
||||
|
||||
Requires: kvm
|
||||
|
||||
%if 0%{?fedora} >= 14 && 0%{?fedora} != 16
|
||||
Requires: cloud-qemu-kvm
|
||||
Requires: cloud-qemu-img
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel} >= 5
|
||||
Requires: qemu-img
|
||||
%endif
|
||||
|
||||
Requires: libcgroup
|
||||
%if 0%{?fedora} >= 16
|
||||
Requires: libcgroup-tools
|
||||
%endif
|
||||
Requires: /usr/bin/uuidgen
|
||||
Requires: rsync
|
||||
Requires: /bin/egrep
|
||||
Requires: /sbin/ip
|
||||
Requires: vconfig
|
||||
Group: System Environment/Libraries
|
||||
%description agent
|
||||
The CloudStack agent is in charge of managing KVM shared computing resources in
|
||||
a CloudStack-powered cloud. Install this package if this computer
|
||||
will participate in your cloud.
|
||||
|
||||
%package baremetal-agent
|
||||
Summary: CloudStack baremetal agent
|
||||
Requires: PING
|
||||
Requires: tftp-server
|
||||
Requires: xinetd
|
||||
Requires: syslinux
|
||||
Requires: chkconfig
|
||||
Requires: dhcp
|
||||
Group: System Environment/Libraries
|
||||
%description baremetal-agent
|
||||
The CloudStack baremetal agent
|
||||
|
||||
%package cli
|
||||
Summary: CloudStack command line tools
|
||||
Requires: python
|
||||
Group: System Environment/Libraries
|
||||
%description cli
|
||||
The CloudStack command line tools contain a few Python modules that can call cloudStack APIs.
|
||||
|
||||
%package usage
|
||||
Summary: CloudStack usage monitor
|
||||
Obsoletes: vmops-usage < %{version}-%{release}
|
||||
Requires: java >= 1.6.0
|
||||
Requires: %{name}-utils = %{version}, %{name}-core = %{version}, %{name}-deps = %{version}, %{name}-server = %{version}
|
||||
Requires: %{name}-setup = %{version}
|
||||
Requires: %{name}-client = %{version}
|
||||
Requires: jsvc
|
||||
License: Apache License 2.0
|
||||
Group: System Environment/Libraries
|
||||
%description usage
|
||||
The CloudStack usage monitor provides usage accounting across the entire cloud for
|
||||
cloud operators to charge based on usage parameters.
|
||||
|
||||
%package aws-api
|
||||
Summary: CloudStack CloudBridge
|
||||
Group: System Environment/Libraries
|
||||
Requires: java >= 1.6.0
|
||||
Requires: tomcat6
|
||||
Requires: %{name}-deps = %{version}
|
||||
%if 0%{?fedora} > 15
|
||||
Requires: apache-commons-lang
|
||||
%endif
|
||||
%if 0%{?rhel} >= 5
|
||||
Requires: jakarta-commons-lang
|
||||
%endif
|
||||
Obsoletes: cloud-bridge < %{version}-%{release}
|
||||
%description aws-api
|
||||
This is the CloudStack CloudBridge
|
||||
|
||||
%prep
|
||||
|
||||
echo Doing CloudStack build
|
||||
|
||||
%setup -q -n %{name}-%{_ver}
|
||||
|
||||
%build
|
||||
|
||||
# this fixes the /usr/com bug on centos5
|
||||
%define _localstatedir /var
|
||||
%define _sharedstatedir /var/lib
|
||||
./waf configure --prefix=%{_prefix} --libdir=%{_libdir} --bindir=%{_bindir} --javadir=%{_javadir} --sharedstatedir=%{_sharedstatedir} --localstatedir=%{_localstatedir} --sysconfdir=%{_sysconfdir} --mandir=%{_mandir} --docdir=%{_docdir}/%{name}-%{version} --with-tomcat=%{_datadir}/tomcat6 --tomcat-user=%{name} --fast --build-number=%{_ver}-%{release} --package-version=%{_ver}
|
||||
./waf build --build-number=%{?_build_number} --package-version=%{_ver}
|
||||
|
||||
%install
|
||||
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
|
||||
# we put the build number again here, otherwise state checking will cause an almost-full recompile
|
||||
./waf install --destdir=$RPM_BUILD_ROOT --nochown --build-number=%{?_build_number}
|
||||
rm $RPM_BUILD_ROOT/etc/rc.d/init.d/cloud-console-proxy
|
||||
rm $RPM_BUILD_ROOT/usr/bin/cloud-setup-console-proxy
|
||||
rm $RPM_BUILD_ROOT/usr/libexec/console-proxy-runner
|
||||
ant deploy-rpm-install -Drpm.install.dir=$RPM_BUILD_ROOT
|
||||
|
||||
%clean
|
||||
|
||||
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
|
||||
%preun client
|
||||
/sbin/service %{name}-management stop || true
|
||||
if [ "$1" == "0" ] ; then
|
||||
/sbin/chkconfig --del %{name}-management > /dev/null 2>&1 || true
|
||||
/sbin/service %{name}-management stop > /dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
%pre aws-api
|
||||
id %{name} > /dev/null 2>&1 || /usr/sbin/useradd -M -c "CloudStack unprivileged user" \
|
||||
-r -s /bin/sh -d %{_sharedstatedir}/%{name}/management %{name}|| true
|
||||
|
||||
rm -rf %{_localstatedir}/cache/%{name}
|
||||
# user harcoded here, also hardcoded on wscript
|
||||
|
||||
%pre client-ui
|
||||
if [ -d %{_datadir}/%{name}/management/webapps/client/ ]; then
|
||||
pushd /tmp &>/dev/null
|
||||
file=cloud-ui-backup-%(date +%%F).tar.bz2
|
||||
cp -r %{_datadir}/%{name}/management/webapps/client/ .
|
||||
tar cjf "$file" client/
|
||||
rm -rf client/
|
||||
mkdir -p /usr/share/cloud/ui-backup/
|
||||
mv "$file" /usr/share/cloud/ui-backup/
|
||||
popd &>/dev/null
|
||||
fi
|
||||
|
||||
%preun usage
|
||||
if [ "$1" == "0" ] ; then
|
||||
/sbin/chkconfig --del %{name}-usage > /dev/null 2>&1 || true
|
||||
/sbin/service %{name}-usage stop > /dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
%pre usage
|
||||
id %{name} > /dev/null 2>&1 || /usr/sbin/useradd -M -c "CloudStack unprivileged user" \
|
||||
-r -s /bin/sh -d %{_sharedstatedir}/%{name}/management %{name}|| true
|
||||
# user harcoded here, also hardcoded on wscript
|
||||
|
||||
%post usage
|
||||
if [ "$1" == "1" ] ; then
|
||||
/sbin/chkconfig --add %{name}-usage > /dev/null 2>&1 || true
|
||||
/sbin/chkconfig --level 345 %{name}-usage on > /dev/null 2>&1 || true
|
||||
else
|
||||
/sbin/service %{name}-usage condrestart >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
%preun agent
|
||||
if [ "$1" == "0" ] ; then
|
||||
/sbin/chkconfig --del %{name}-agent > /dev/null 2>&1 || true
|
||||
/sbin/service %{name}-agent stop > /dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
%post agent
|
||||
if [ "$1" == "1" ] ; then
|
||||
/sbin/chkconfig --add %{name}-agent > /dev/null 2>&1 || true
|
||||
/sbin/chkconfig --level 345 %{name}-agent on > /dev/null 2>&1 || true
|
||||
else
|
||||
/sbin/service %{name}-agent condrestart >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
if [ -x /etc/sysconfig/modules/kvm.modules ] ; then
|
||||
/bin/sh /etc/sysconfig/modules/kvm.modules
|
||||
fi
|
||||
|
||||
%post client
|
||||
/sbin/chkconfig --add %{name}-management > /dev/null 2>&1 || true
|
||||
/sbin/chkconfig --level 345 %{name}-management on > /dev/null 2>&1 || true
|
||||
|
||||
root=/usr/share/cloud/bridge
|
||||
target=/usr/share/cloud/management
|
||||
|
||||
mkdir -p $target/webapps7080
|
||||
if [ ! -h $target/webapps7080/awsapi ]; then
|
||||
ln -sf $root/webapps7080/awsapi $target/webapps7080/awsapi
|
||||
fi
|
||||
|
||||
# jars=`ls $root/lib`
|
||||
# for j in $jars
|
||||
# do
|
||||
# cp -f $root/lib/$j $root/webapps/awsapi/WEB-INF/lib/
|
||||
# done
|
||||
|
||||
confs="cloud-bridge.properties ec2-service.properties"
|
||||
for c in $confs
|
||||
do
|
||||
cp -f $root/conf/$c $target/conf
|
||||
done
|
||||
|
||||
%files utils
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_javadir}/%{name}-utils.jar
|
||||
%{_javadir}/%{name}-api.jar
|
||||
%attr(0755,root,root) %{_bindir}/cloud-sccs
|
||||
%attr(0755,root,root) %{_bindir}/cloud-gitrevs
|
||||
%doc %{_docdir}/%{name}-%{version}/version-info
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files client-ui
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_datadir}/%{name}/management/webapps/client/*
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files server
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_javadir}/%{name}-server.jar
|
||||
%{_javadir}/%{name}-ovm.jar
|
||||
%{_javadir}/%{name}-dp-user-concentrated-pod.jar
|
||||
%{_javadir}/%{name}-dp-user-dispersing.jar
|
||||
%{_javadir}/%{name}-host-allocator-random.jar
|
||||
%{_javadir}/%{name}-plugin-ovs.jar
|
||||
%{_javadir}/%{name}-storage-allocator-random.jar
|
||||
%{_javadir}/%{name}-user-authenticator-ldap.jar
|
||||
%{_javadir}/%{name}-user-authenticator-md5.jar
|
||||
%{_javadir}/%{name}-user-authenticator-plaintext.jar
|
||||
%{_javadir}/%{name}-plugin-hypervisor-xen.jar
|
||||
%{_javadir}/%{name}-plugin-elb.jar
|
||||
%{_javadir}/%{name}-plugin-nicira-nvp.jar
|
||||
%{_javadir}/%{name}-plugin-bigswitch-vns.jar
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/server/*
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files scripts
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/%{name}/common/scripts/*
|
||||
# maintain the following list in sync with files scripts
|
||||
%{_libdir}/%{name}/common/vms/systemvm.zip
|
||||
%{_libdir}/%{name}/common/vms/systemvm.iso
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files deps
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_javadir}/axiom-*.jar
|
||||
%{_javadir}/axis2-*.jar
|
||||
%{_javadir}/antlr*.jar
|
||||
%{_javadir}/XmlSchema-*.jar
|
||||
%{_javadir}/json-simple*.jar
|
||||
%{_javadir}/neethi*.jar
|
||||
%{_javadir}/woden*.jar
|
||||
%{_javadir}/xercesImpl*.jar
|
||||
%{_javadir}/xml-apis*.jar
|
||||
%{_javadir}/dom4j*.jar
|
||||
%{_javadir}/javassist*.jar
|
||||
%{_javadir}/commons-fileupload*.jar
|
||||
%{_javadir}/commons-codec-1.6.jar
|
||||
%{_javadir}/commons-dbcp-1.4.jar
|
||||
%{_javadir}/commons-pool-1.6.jar
|
||||
%{_javadir}/gson-1.7.1.jar
|
||||
%{_javadir}/CAStorSDK-*.jar
|
||||
%{_javadir}/backport-util-concurrent-3.1.jar
|
||||
%{_javadir}/ehcache-1.5.0.jar
|
||||
%{_javadir}/httpcore-4.0.jar
|
||||
%{_javadir}/mail-1.4.jar
|
||||
%{_javadir}/activation-1.1.jar
|
||||
%{_javadir}/xapi-5.6.100-1-SNAPSHOT.jar
|
||||
%{_javadir}/log4j-*.jar
|
||||
%{_javadir}/apache-log4j-extras-1.1.jar
|
||||
%{_javadir}/trilead-ssh2-build213-svnkit-1.3-patch.jar
|
||||
%{_javadir}/cglib-nodep-2.2.2.jar
|
||||
%{_javadir}/xmlrpc-common-3.*.jar
|
||||
%{_javadir}/xmlrpc-client-3.*.jar
|
||||
%{_javadir}/wsdl4j-1.6.2.jar
|
||||
%{_javadir}/jsch-0.1.42.jar
|
||||
%{_javadir}/jasypt-1.*.jar
|
||||
%{_javadir}/commons-configuration-1.8.jar
|
||||
%{_javadir}/ejb-api-3.0.jar
|
||||
%{_javadir}/axis2-1.5.1.jar
|
||||
%{_javadir}/commons-discovery-0.5.jar
|
||||
%{_javadir}/jstl-1.2.jar
|
||||
%{_javadir}/javax.persistence-2.0.0.jar
|
||||
%{_javadir}/bcprov-jdk16-1.45.jar
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files core
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_javadir}/%{name}-core.jar
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files python
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_prefix}/lib*/python*/site-packages/%{name}*
|
||||
%attr(0755,root,root) %{_bindir}/cloud-external-ipallocator.py
|
||||
%attr(0755,root,root) %{_initrddir}/cloud-ipallocator
|
||||
%dir %attr(0770,root,root) %{_localstatedir}/log/%{name}/ipallocator
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files setup
|
||||
%attr(0755,root,root) %{_bindir}/%{name}-setup-databases
|
||||
%attr(0755,root,root) %{_bindir}/%{name}-migrate-databases
|
||||
%attr(0755,root,root) %{_bindir}/%{name}-set-guest-password
|
||||
%attr(0755,root,root) %{_bindir}/%{name}-set-guest-sshkey
|
||||
%attr(0755,root,root) %{_bindir}/%{name}-sysvmadm
|
||||
%attr(0755,root,root) %{_bindir}/%{name}-setup-encryption
|
||||
%dir %{_datadir}/%{name}/setup
|
||||
%{_datadir}/%{name}/setup/*.sql
|
||||
%{_datadir}/%{name}/setup/db/*.sql
|
||||
%{_datadir}/%{name}/setup/*.sh
|
||||
%{_datadir}/%{name}/setup/server-setup.xml
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files client
|
||||
%defattr(0644,root,root,0775)
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/management
|
||||
%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/%{name}/management/db.properties
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/management/log4j-%{name}.xml
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/management/tomcat6.conf
|
||||
%dir %attr(0770,root,%{name}) %{_sysconfdir}/%{name}/management/Catalina
|
||||
%dir %attr(0770,root,%{name}) %{_sysconfdir}/%{name}/management/Catalina/localhost
|
||||
%dir %attr(0770,root,%{name}) %{_sysconfdir}/%{name}/management/Catalina/localhost/client
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-management
|
||||
%attr(0755,root,root) %{_initrddir}/%{name}-management
|
||||
%dir %{_datadir}/%{name}/management
|
||||
%{_datadir}/%{name}/management/*
|
||||
%attr(0755,root,root) %{_bindir}/%{name}-setup-management
|
||||
%attr(0755,root,root) %{_bindir}/%{name}-update-xenserver-licenses
|
||||
%dir %attr(0770,root,%{name}) %{_sharedstatedir}/%{name}/mnt
|
||||
%dir %attr(0770,%{name},%{name}) %{_sharedstatedir}/%{name}/management
|
||||
%dir %attr(0770,root,%{name}) %{_localstatedir}/cache/%{name}/management
|
||||
%dir %attr(0770,root,%{name}) %{_localstatedir}/cache/%{name}/management/work
|
||||
%dir %attr(0770,root,%{name}) %{_localstatedir}/cache/%{name}/management/temp
|
||||
%dir %attr(0770,root,%{name}) %{_localstatedir}/log/%{name}/management
|
||||
%dir %attr(0770,root,%{name}) %{_localstatedir}/log/%{name}/agent
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files agent-libs
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_javadir}/%{name}-agent.jar
|
||||
%{_javadir}/%{name}-plugin-hypervisor-kvm.jar
|
||||
%{_javadir}/libvirt-0.4.9.jar
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files agent
|
||||
%defattr(0644,root,root,0755)
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/agent/agent.properties
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/agent/developer.properties.template
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/agent/environment.properties
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/agent/log4j-%{name}.xml
|
||||
%attr(0755,root,root) %{_initrddir}/%{name}-agent
|
||||
%attr(0755,root,root) %{_bindir}/%{name}-setup-agent
|
||||
%attr(0755,root,root) %{_bindir}/%{name}-ssh
|
||||
%dir %attr(0770,root,root) %{_localstatedir}/log/%{name}/agent
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files cli
|
||||
%{_bindir}/%{name}-tool
|
||||
%{_bindir}/cloudvoladm
|
||||
%{_bindir}/cloud-grab-dependent-library-versions
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/cli/commands.xml
|
||||
%dir %{_prefix}/lib*/python*/site-packages/%{name}tool
|
||||
%{_prefix}/lib*/python*/site-packages/%{name}tool/*
|
||||
%{_prefix}/lib*/python*/site-packages/%{name}apis.py
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files baremetal-agent
|
||||
%attr(0755,root,root) %{_bindir}/cloud-setup-baremetal
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files usage
|
||||
%defattr(0644,root,root,0775)
|
||||
%{_javadir}/%{name}-usage.jar
|
||||
%attr(0755,root,root) %{_initrddir}/%{name}-usage
|
||||
%dir %attr(0770,root,%{name}) %{_localstatedir}/log/%{name}/usage
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/usage/usage-components.xml
|
||||
%config(noreplace) %{_sysconfdir}/%{name}/usage/log4j-%{name}_usage.xml
|
||||
%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/%{name}/usage/db.properties
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%files aws-api
|
||||
%defattr(0644,cloud,cloud,0755)
|
||||
%{_datadir}/cloud/bridge/conf/*
|
||||
%{_datadir}/cloud/bridge/webapps7080/*
|
||||
%attr(0644,root,root) %{_datadir}/cloud/setup/bridge/db/*
|
||||
%attr(0755,root,root) %{_bindir}/cloudstack-aws-api-register
|
||||
%attr(0755,root,root) %{_bindir}/cloud-setup-bridge
|
||||
%doc LICENSE
|
||||
%doc NOTICE
|
||||
|
||||
%changelog
|
||||
* Mon Nov 19 2012 Satoshi Kobayashi <satoshi-k@stratosphere.co.jp> 4.0.1
|
||||
- adding dependency bridge-utils to fix a system requirement
|
||||
|
||||
* Fri Sep 14 2012 Marcus Sorensen <shadowsor@gmail.com> 4.0.1
|
||||
- adding dependency jakarta-commons-daemon to fix "cannot find daemon loader"
|
||||
|
||||
* Thu Aug 16 2012 Marcus Sorensen <shadowsor@gmail.com> 4.0
|
||||
- rearranged files sections to match currently built files
|
||||
|
||||
* Mon May 3 2010 Manuel Amador (Rudd-O) <manuel@vmops.com> 1.9.12
|
||||
- Bump version for RC4 release
|
||||
|
||||
* Fri Apr 30 2010 Manuel Amador (Rudd-O) <manuel@vmops.com> 1.9.11
|
||||
- Rename to CloudStack everywhere
|
||||
|
||||
* Wed Apr 28 2010 Manuel Amador (Rudd-O) <manuel@vmops.com> 1.9.10
|
||||
- FOSS release
|
||||
|
||||
* Mon Apr 05 2010 Manuel Amador (Rudd-O) <manuel@vmops.com> 1.9.8
|
||||
- RC3 branched
|
||||
|
||||
* Wed Feb 17 2010 Manuel Amador (Rudd-O) <manuel@vmops.com> 1.9.7
|
||||
- First initial broken-up release
|
||||
|
||||
|
||||
44
waf.bat
44
waf.bat
@ -1,44 +0,0 @@
|
||||
@echo off
|
||||
rem Licensed to the Apache Software Foundation (ASF) under one
|
||||
rem or more contributor license agreements. See the NOTICE file
|
||||
rem distributed with this work for additional information
|
||||
rem regarding copyright ownership. The ASF licenses this file
|
||||
rem to you under the Apache License, Version 2.0 (the
|
||||
rem "License"); you may not use this file except in compliance
|
||||
rem with the License. You may obtain a copy of the License at
|
||||
rem
|
||||
rem http://www.apache.org/licenses/LICENSE-2.0
|
||||
rem
|
||||
rem Unless required by applicable law or agreed to in writing,
|
||||
rem software distributed under the License is distributed on an
|
||||
rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
rem KIND, either express or implied. See the License for the
|
||||
rem specific language governing permissions and limitations
|
||||
rem under the License.
|
||||
|
||||
if exist jython.jar goto runjython
|
||||
if exist C:\Python26\Python.exe goto runpython
|
||||
goto helprun
|
||||
|
||||
:helprun
|
||||
echo To run waf with Python
|
||||
echo 1. Download Python 2.6 for Windows from http://www.python.org/
|
||||
echo 2. Install it in C:\Python2.6 (the default path)
|
||||
echo 3. Use this batch file to run waf
|
||||
echo ""
|
||||
echo To run waf without installing Python
|
||||
echo 1. Download the Jython installer from http://wiki.python.org/jython/
|
||||
echo 2. Install it to this directory in standalone mode
|
||||
echo 3. Ensure the java command is on your PATH variable
|
||||
echo 3. Use this batch file to run waf
|
||||
goto end
|
||||
|
||||
:runjython
|
||||
java -jar jython.jar waf %*
|
||||
goto end
|
||||
|
||||
:runpython
|
||||
C:\Python26\Python.exe waf %*
|
||||
goto end
|
||||
|
||||
:end
|
||||
782
wscript
782
wscript
@ -1,782 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
|
||||
|
||||
# the following variables are used by the target "waf dist"
|
||||
# if you change APPNAME here, you need to change 'Name' also
|
||||
# in cloud.spec, add a %changelog entry there, and add an
|
||||
# entry in debian/changelog. SHORTVERSION is used in package
|
||||
# naming for deb/rpm, VERSION is used for tarball and bin
|
||||
VERSION = '4.0.0.2012-08-15T18:03:12Z'
|
||||
SHORTVERSION = '4.0.0'
|
||||
APPNAME = 'cloud'
|
||||
|
||||
import shutil,os
|
||||
import email,time
|
||||
import optparse
|
||||
import Utils,Node,Options,Logs,Scripting,Environment,Build,Configure
|
||||
from subprocess import Popen as _Popen,PIPE
|
||||
import os
|
||||
import sys
|
||||
from os import unlink as _unlink, makedirs as _makedirs, getcwd as _getcwd, chdir as _chdir
|
||||
from os.path import abspath as _abspath, basename as _basename, dirname as _dirname, exists as _exists, isdir as _isdir, split as _split, join as _join, sep, pathsep, pardir, curdir
|
||||
from glob import glob as _glob
|
||||
import zipfile,tarfile
|
||||
try:
|
||||
from os import chmod as _chmod,chown as _chown
|
||||
import pwd,stat,grp
|
||||
except ImportError:
|
||||
_chmod,_chown,pwd,stat,grp = (None,None,None,None,None)
|
||||
import xml.dom.minidom
|
||||
import re
|
||||
|
||||
# these variables are mandatory ('/' are converted automatically)
|
||||
srcdir = '.'
|
||||
blddir = 'artifacts'
|
||||
|
||||
Configure.autoconfig = True
|
||||
|
||||
# things not to include in the source tarball
|
||||
# exclude by file name or by _glob (wildcard matching)
|
||||
for _globber in [
|
||||
["dist", # does not belong in the source tarball
|
||||
"system", # for windows
|
||||
"override", # not needed
|
||||
"eclipse", # only there to please eclipse
|
||||
"repomanagement", # internal management stuff
|
||||
"client-api", # obsolete
|
||||
"cloud-bridge", # not compiled and packaged yet
|
||||
"target", # eclipse workdir
|
||||
"apache-log4j-1.2.16",
|
||||
"apache-log4j-extras-1.1",
|
||||
"cglib",
|
||||
"gson",
|
||||
"ehcache",
|
||||
"vhd-tools",
|
||||
"xmlrpc",
|
||||
"PreviousDatabaseSchema",
|
||||
"mockito",
|
||||
"gcc",
|
||||
"junit" ],
|
||||
_glob("./*.disabledblahxml"),
|
||||
]:
|
||||
for f in _globber: Scripting.excludes.append(_basename(f)) # _basename() only the filename
|
||||
|
||||
# things never to consider when building or installing
|
||||
for pattern in ["**/.project","**/.classpath","**/.pydevproject"]: Node.exclude_regs += "\n%s"%pattern
|
||||
|
||||
# Support functions
|
||||
|
||||
def distclean(ctx):
|
||||
"""Clear the build artifacts"""
|
||||
for root, folder, files in os.walk(blddir):
|
||||
for f in files:
|
||||
path = os.path.join(root, f)
|
||||
print "Removing artifact %s"%path
|
||||
os.remove(path)
|
||||
|
||||
def inspectobj(x):
|
||||
"""Look inside an object"""
|
||||
for m in dir(x): print m,": ",getattr(x,m)
|
||||
Utils.inspectobj = inspectobj
|
||||
|
||||
def _trm(x,y):
|
||||
if len(x) > y: return x[:y] + "..."
|
||||
return x
|
||||
|
||||
def getrpmdeps():
|
||||
def rpmdeps(fileset):
|
||||
for f in fileset:
|
||||
lines = file(f).readlines()
|
||||
lines = [ x[len("BuildRequires: "):] for x in lines if x.startswith("BuildRequires") ]
|
||||
for l in lines:
|
||||
deps = [ x.strip() for x in l.split(",") ]
|
||||
for d in deps:
|
||||
if "%s-"%APPNAME in d: continue
|
||||
yield d
|
||||
yield "rpm-build"
|
||||
|
||||
deps = set(rpmdeps(_glob("./*.spec")))
|
||||
deps.add("ant")
|
||||
return deps
|
||||
|
||||
# CENTOS does not have this -- we have to put this here
|
||||
try:
|
||||
from subprocess import check_call as _check_call
|
||||
from subprocess import CalledProcessError
|
||||
except ImportError:
|
||||
def _check_call(*popenargs, **kwargs):
|
||||
import subprocess
|
||||
retcode = subprocess.call(*popenargs, **kwargs)
|
||||
cmd = kwargs.get("args")
|
||||
if cmd is None: cmd = popenargs[0]
|
||||
if retcode: raise CalledProcessError(retcode, cmd)
|
||||
return retcode
|
||||
|
||||
class CalledProcessError(Exception):
|
||||
def __init__(self, returncode, cmd):
|
||||
self.returncode = returncode ; self.cmd = cmd
|
||||
def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
|
||||
def throws_command_errors(f):
|
||||
def g(*args,**kwargs):
|
||||
try: return f(*args,**kwargs)
|
||||
except CalledProcessError,e:
|
||||
raise Utils.WafError("system command %s failed with error value %s"%(e.cmd[0],e.returncode))
|
||||
except IOError,e:
|
||||
if e.errno is 32:
|
||||
raise Utils.WafError("system command %s terminated abruptly, closing communications with parent's pipe"%e.cmd[0])
|
||||
raise
|
||||
return g
|
||||
|
||||
def c(cmdlist,cwd=None):
|
||||
# Run a command with _check_call, pretty-printing the cmd list
|
||||
Utils.pprint("BLUE"," ".join(cmdlist))
|
||||
return _check_call(cmdlist,cwd=cwd)
|
||||
|
||||
def svninfo(*args):
|
||||
try: p = _Popen(['svn','info']+list(args),stdin=PIPE,stdout=PIPE,stderr=PIPE)
|
||||
except OSError,e:
|
||||
if e.errno == 2: return '' # svn command is not installed
|
||||
raise
|
||||
stdout,stderr = p.communicate('')
|
||||
retcode = p.wait()
|
||||
# If the guess fails, just return nothing.
|
||||
if retcode: return
|
||||
# SVN available
|
||||
rev = [ x for x in stdout.splitlines() if x.startswith('Revision') ]
|
||||
if not rev: rev = ''
|
||||
else: rev = "SVN " + rev[0].strip()
|
||||
url = [ x for x in stdout.splitlines() if x.startswith('URL') ]
|
||||
if not url: url = ''
|
||||
else: url = "SVN " + url[0].strip()
|
||||
return rev + "\n" + url
|
||||
|
||||
def gitinfo(dir=None):
|
||||
if dir and not _isdir(dir): return ''
|
||||
try: p = _Popen(['git','remote','show','-n','origin'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir)
|
||||
except OSError,e:
|
||||
if e.errno == 2: return '' # svn command is not installed
|
||||
raise
|
||||
stdout,stderr = p.communicate('')
|
||||
retcode = p.wait()
|
||||
# If the guess fails, just return nothing.
|
||||
if retcode: return
|
||||
stdout = [ s.strip() for s in stdout.splitlines() ]
|
||||
try: url = [ s[11:] for s in stdout if s.startswith("Fetch URL") ][0]
|
||||
except IndexError: url = [ s[5:] for s in stdout if s.startswith("URL") ][0]
|
||||
assert url
|
||||
|
||||
p = _Popen(['git','log','-1'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir)
|
||||
stdout,stderr = p.communicate('')
|
||||
retcode = p.wait()
|
||||
if retcode: return
|
||||
# If the guess fails, just return nothing.
|
||||
stdout = [ s.strip() for s in stdout.splitlines() ]
|
||||
commitid = [ s.split()[1] for s in stdout if s.startswith("commit") ][0]
|
||||
assert commitid
|
||||
|
||||
return "Git Revision: %s"%commitid + "\n" + "Git URL: %s"%url
|
||||
|
||||
def allgitinfo():
|
||||
t = gitinfo()
|
||||
if not t: return t
|
||||
|
||||
u = gitinfo(_join(pardir,"cloudstack-proprietary"))
|
||||
if not u: return t
|
||||
|
||||
return t + "\n\ncloustack-proprietary:\n" + u
|
||||
|
||||
def _getbuildnumber(): # FIXME implement for git
|
||||
n = Options.options.BUILDNUMBER
|
||||
if n:
|
||||
# luntbuild prepends "build-" to the build number. we work around this here:
|
||||
if n.startswith("build-"): n = n[6:]
|
||||
# SVN identifiers prepend "$Revision:" to the build number. we work around this here:
|
||||
if n.startswith("$Revision:"): n = n[11:-2].strip()
|
||||
return n
|
||||
else:
|
||||
# Try to guess the SVN revision number by calling SVN info.
|
||||
stdout = svninfo()
|
||||
if not stdout: return ''
|
||||
# Filter lines.
|
||||
rev = [ x for x in stdout.splitlines() if x.startswith('SVN Revision') ]
|
||||
if not rev: return ''
|
||||
# Parse revision number.
|
||||
rev = rev[0][14:].strip()
|
||||
return rev
|
||||
Utils.getbuildnumber = _getbuildnumber
|
||||
|
||||
def mkdir_p(directory):
|
||||
if not _isdir(directory):
|
||||
Utils.pprint("GREEN","Creating directory %s and necessary parents"%directory)
|
||||
_makedirs(directory)
|
||||
|
||||
def relpath(path, start="."):
|
||||
if not path: raise ValueError("no path specified")
|
||||
|
||||
start_list = os.path.abspath(start).split(sep)
|
||||
path_list = os.path.abspath(path).split(sep)
|
||||
|
||||
# Work out how much of the filepath is shared by start and path.
|
||||
i = len(os.path.commonprefix([start_list, path_list]))
|
||||
|
||||
rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
|
||||
if not rel_list:
|
||||
return curdir
|
||||
return os.path.join(*rel_list)
|
||||
Utils.relpath = relpath
|
||||
|
||||
def dev_override(pathname):
|
||||
p,e = _split(pathname)
|
||||
overridden = _join(p,"override",e)
|
||||
if _exists(overridden): return overridden
|
||||
return pathname
|
||||
|
||||
def discover_ant_targets_and_properties(files):
|
||||
doms = [ xml.dom.minidom.parseString(file(f).read(-1)) for f in files if f.endswith(".xml") ]
|
||||
targets = dict( [ (target.getAttribute("name"),target) for dom in doms for target in dom.getElementsByTagName("target") if target.getElementsByTagName("compile-java") ] )
|
||||
propsinxml = [ (prop.getAttribute("name"),prop.getAttribute("value") or prop.getAttribute("location")) for dom in doms for prop in dom.getElementsByTagName("property") ]
|
||||
propsinpropfiles = [ l.strip().split("=",1) for f in files if f.endswith(".properties") for l in file(f).readlines() if "=" in l and not l.startswith("#") ]
|
||||
props = dict( propsinxml + propsinpropfiles )
|
||||
props["base.dir"] = '.'
|
||||
props["p.base.dir"] = '.'
|
||||
|
||||
result = []
|
||||
for name,target in targets.items():
|
||||
sourcedir = target.getElementsByTagName("compile-java")[0].getAttribute("top.dir") + "/src"
|
||||
classdir = "${classes.dir}/" + target.getElementsByTagName("compile-java")[0].getAttribute("jar.name")
|
||||
jarpath = "${jar.dir}/" + target.getElementsByTagName("compile-java")[0].getAttribute("jar.name")
|
||||
def lookup(matchobject): return props[matchobject.group(1)]
|
||||
while "$" in sourcedir: sourcedir = re.sub("\${(.+?)}",lookup,sourcedir)
|
||||
while "$" in classdir: classdir = re.sub("\${(.+?)}",lookup,classdir)
|
||||
while "$" in jarpath: jarpath= re.sub("\${(.+?)}",lookup,jarpath)
|
||||
dependencies = [ dep.strip() for dep in target.getAttribute("depends").split(",") if dep.strip() in targets ]
|
||||
result.append([str(name),str(relpath(sourcedir)),str(relpath(classdir)),str(relpath(jarpath)),[str(s) for s in dependencies]])
|
||||
# hardcoded here because the discovery process does not get it
|
||||
result.append( ["build-console-viewer","console-viewer/src", "target/classes/console-viewer", "target/jar/VMOpsConsoleApplet.jar", ["compile-utils","compile-console-common"] ] )
|
||||
return result,props
|
||||
Utils.discover_ant_targets_and_properties = discover_ant_targets_and_properties
|
||||
|
||||
# this snippet of code runs a list of ant targets
|
||||
# then it expects a certain set of JAR files to be output in the artifacts/default/ant/jar directory
|
||||
# this set of jar files is defined here in the variable jartgts, and must match the definitions at the bottom of
|
||||
# build/package.xml and build/premium/package-premium.xml
|
||||
# this is NOT a task for a task generator -- it is a plain function.
|
||||
# If you want to use it as a task function in a task generator, use a lambda x: runant("targetname")
|
||||
def runant(tsk):
|
||||
|
||||
environ = dict(os.environ)
|
||||
environ["CATALINA_HOME"] = tsk.env.TOMCATHOME
|
||||
if tsk.generator.env.DISTRO == "Windows":
|
||||
stanzas = [
|
||||
"ant",
|
||||
"-Dthirdparty.classpath=\"%s\""%(tsk.env.CLASSPATH.replace(os.pathsep,",")),
|
||||
]
|
||||
else:
|
||||
stanzas = [
|
||||
"ant",
|
||||
"-Dthirdparty.classpath=%s"%(tsk.env.CLASSPATH.replace(os.pathsep,",")),
|
||||
]
|
||||
stanzas += tsk.generator.antargs
|
||||
ret = Utils.exec_command(" ".join(stanzas),cwd=tsk.generator.bld.srcnode.abspath(),env=environ,log=True)
|
||||
if ret != 0: raise Utils.WafError("Ant command %s failed with error value %s"%(stanzas,ret))
|
||||
return ret
|
||||
Utils.runant = runant
|
||||
|
||||
@throws_command_errors
|
||||
def run_java(classname,classpath,options=None,arguments=None):
|
||||
if not options: options = []
|
||||
if not arguments: arguments = []
|
||||
if type(classpath) in [list,tuple]: classpath = pathsep.join(classpath)
|
||||
|
||||
Utils.pprint("BLUE","Run-time CLASSPATH:")
|
||||
for v in classpath.split(pathsep): Utils.pprint("BLUE"," %s"%v)
|
||||
|
||||
cmd = ["java","-classpath",classpath] + options + [classname] + arguments
|
||||
Utils.pprint("BLUE"," ".join([ _trm(x,32) for x in cmd ]))
|
||||
_check_call(cmd)
|
||||
|
||||
# this will enforce the after= ordering constraints in the javac task generators
|
||||
from TaskGen import after, feature
|
||||
@feature('*')
|
||||
@after('apply_core', 'apply_java', 'apply_subst')
|
||||
def process_after(self):
|
||||
lst = self.to_list(getattr(self, 'after', []))
|
||||
for x in lst:
|
||||
obj = self.bld.name_to_obj(x,self.bld.env)
|
||||
if not obj: break
|
||||
obj.post()
|
||||
for a in obj.tasks:
|
||||
for b in self.tasks:
|
||||
b.set_run_after(a)
|
||||
|
||||
Build.BuildContext.process_after = staticmethod(process_after)
|
||||
|
||||
def _getbuildcontext():
|
||||
ctx = Build.BuildContext()
|
||||
ctx.load_dirs(_abspath(srcdir),_abspath(blddir))
|
||||
ctx.load_envs()
|
||||
return ctx
|
||||
|
||||
def _install_files_filtered(self,destdir,listoffiles,**kwargs):
|
||||
if "cwd" in kwargs: cwd = kwargs["cwd"]
|
||||
else: cwd = self.path
|
||||
if isinstance(listoffiles,str) and '**' in listoffiles:
|
||||
listoffiles = cwd.ant_glob(listoffiles,flat=True)
|
||||
elif isinstance(listoffiles,str) and '*' in listoffiles:
|
||||
listoffiles = [ n for x in listoffiles.split() for n in _glob(cwd.abspath() + os.sep + x.replace("/",os.sep)) ]
|
||||
listoffiles = Utils.to_list(listoffiles)[:]
|
||||
listoffiles = [ x for x in listoffiles if not ( x.endswith("~") or x == "override" or "%soverride"%os.sep in x ) ]
|
||||
for n,f in enumerate(listoffiles):
|
||||
f = os.path.abspath(f)
|
||||
f = dev_override(f)
|
||||
if _isdir(f): continue
|
||||
if f.endswith(".in"):
|
||||
source = f ; target = f[:-3]
|
||||
tgen = self(features='subst', source=source[len(self.path.abspath())+1:], target=target[len(self.path.abspath())+1:], name="filtered_%s"%source)
|
||||
tgen.dict = self.env.get_merged_dict()
|
||||
else:
|
||||
source = f ; target = f
|
||||
listoffiles[n] = target[len(cwd.abspath())+1:]
|
||||
if "postpone" not in kwargs: kwargs["postpone"] = True
|
||||
ret = self.install_files(destdir,listoffiles,**kwargs)
|
||||
return ret
|
||||
Build.BuildContext.install_files_filtered = _install_files_filtered
|
||||
|
||||
def _substitute(self,listoffiles,install_to=None,cwd=None,dict=None,name=None,**kwargs):
|
||||
if cwd is None: cwd = self.path
|
||||
tgenkwargs = {}
|
||||
if name is not None: tgenkwargs["name"] = name
|
||||
if isinstance(listoffiles,str) and '**' in listoffiles:
|
||||
listoffiles = cwd.ant_glob(listoffiles,flat=True)
|
||||
elif isinstance(listoffiles,str) and '*' in listoffiles:
|
||||
listoffiles = [ n for x in listoffiles.split() for n in _glob(cwd.abspath() + os.sep + x.replace("/",os.sep)) ]
|
||||
for src in Utils.to_list(listoffiles):
|
||||
tgt = src + ".subst"
|
||||
inst = src # Utils.relpath(src,relative_to) <- disabled
|
||||
|
||||
# Use cwd path when creating task and shift back later
|
||||
tmp = self.path
|
||||
self.path = cwd
|
||||
tgen = self(features='subst', source=src, target=tgt, **tgenkwargs)
|
||||
self.path = tmp
|
||||
|
||||
if dict is not None: tgen.dict = dict
|
||||
else: tgen.dict = self.env.get_merged_dict()
|
||||
self.path.find_or_declare(tgt)
|
||||
if install_to is not None: self.install_as("%s/%s"%(install_to,inst), tgt, cwd=cwd, **kwargs)
|
||||
Build.BuildContext.substitute = _substitute
|
||||
|
||||
def set_options(opt):
|
||||
"""Register command line options"""
|
||||
opt.tool_options('gnu_dirs')
|
||||
opt.tool_options('python')
|
||||
opt.tool_options('tar',tooldir='tools/waf')
|
||||
opt.tool_options('mkisofs',tooldir='tools/waf')
|
||||
if Options.platform not in ['darwin','win32']: opt.tool_options('usermgmt',tooldir='tools/waf')
|
||||
if Options.platform not in ['darwin','win32']: opt.tool_options('javadir',tooldir='tools/waf')
|
||||
opt.tool_options('tomcat',tooldir='tools/waf')
|
||||
if Options.platform not in ['darwin',"win32"]: opt.tool_options('compiler_cc')
|
||||
|
||||
inst_dir = opt.get_option_group('--srcdir')
|
||||
inst_dir.add_option('--with-db-host',
|
||||
help = 'Database host to use for waf deploydb [Default: 127.0.0.1]',
|
||||
default = '127.0.0.1',
|
||||
dest = 'DBHOST')
|
||||
inst_dir.add_option('--with-db-user',
|
||||
help = 'Database user to use for waf deploydb [Default: root]',
|
||||
default = 'root',
|
||||
dest = 'DBUSER')
|
||||
inst_dir.add_option('--with-db-pw',
|
||||
help = 'Database password to use for waf deploydb [Default: ""]',
|
||||
default = '',
|
||||
dest = 'DBPW')
|
||||
inst_dir.add_option('--tomcat-user',
|
||||
help = 'UNIX user that the management server initscript will switch to [Default: <autodetected>]',
|
||||
default = '',
|
||||
dest = 'MSUSER')
|
||||
inst_dir.add_option('--no-dep-check',
|
||||
action='store_true',
|
||||
help = 'Skip dependency check and assume JARs already exist',
|
||||
default = False,
|
||||
dest = 'NODEPCHECK')
|
||||
inst_dir.add_option('--fast',
|
||||
action='store_true',
|
||||
help = 'does ---no-dep-check',
|
||||
default = False,
|
||||
dest = 'NODEPCHECK')
|
||||
inst_dir = opt.get_option_group('--force')
|
||||
inst_dir.add_option('--preserve-config',
|
||||
action='store_true',
|
||||
help = 'do not install configuration files',
|
||||
default = False,
|
||||
dest = 'PRESERVECONFIG')
|
||||
|
||||
debugopts = optparse.OptionGroup(opt.parser,'run/debug options')
|
||||
opt.add_option_group(debugopts)
|
||||
debugopts.add_option('--debug-port',
|
||||
help = 'Port on which the debugger will listen when running waf debug [Default: 8787]',
|
||||
default = '8787',
|
||||
dest = 'DEBUGPORT')
|
||||
debugopts.add_option('--debug-suspend',
|
||||
action='store_true',
|
||||
help = 'Suspend the process upon startup so that a debugger can attach and set breakpoints',
|
||||
default = False,
|
||||
dest = 'DEBUGSUSPEND')
|
||||
debugopts.add_option('--run-verbose',
|
||||
action='store_true',
|
||||
help = 'Run Tomcat in verbose mode (java option -verbose)',
|
||||
default = False,
|
||||
dest = 'RUNVERBOSE')
|
||||
|
||||
rpmopts = optparse.OptionGroup(opt.parser,'RPM/DEB build options')
|
||||
opt.add_option_group(rpmopts)
|
||||
rpmopts.add_option('--build-number',
|
||||
help = 'Build number [Default: SVN revision number for builds from checkouts, or empty for builds from source releases]',
|
||||
default = '',
|
||||
dest = 'BUILDNUMBER')
|
||||
rpmopts.add_option('--package-version',
|
||||
help = 'package version',
|
||||
default = '',
|
||||
dest = 'VERNUM')
|
||||
rpmopts.add_option('--release-version',
|
||||
help = 'release version',
|
||||
default = '',
|
||||
dest = 'RELEASENUM')
|
||||
rpmopts.add_option('--prerelease',
|
||||
help = 'Branch name to append to the release number (if specified, alter release number to be a prerelease); this option requires --build-number=X [Default: nothing]',
|
||||
default = '',
|
||||
dest = 'PRERELEASE')
|
||||
rpmopts.add_option('--skip-dist',
|
||||
action='store_true',
|
||||
help = 'Normally, dist() is called during package build. This makes the package build assume that a distribution tarball has already been made, and use that. This option is also valid during distcheck and dist.',
|
||||
default = False,
|
||||
dest = 'DONTDIST')
|
||||
|
||||
distopts = optparse.OptionGroup(opt.parser,'dist options')
|
||||
opt.add_option_group(distopts)
|
||||
distopts.add_option('--oss',
|
||||
help = 'Only include open source components',
|
||||
action = 'store_true',
|
||||
default = False,
|
||||
dest = 'OSS')
|
||||
|
||||
def showconfig(conf):
|
||||
"""prints out the current configure environment configuration"""
|
||||
conf = _getbuildcontext()
|
||||
|
||||
Utils.pprint("WHITE","Build environment:")
|
||||
for key,val in sorted(conf.env.get_merged_dict().items()):
|
||||
if "CLASSPATH" in key:
|
||||
Utils.pprint("BLUE"," %s:"%key)
|
||||
for v in val.split(pathsep):
|
||||
Utils.pprint("BLUE"," %s"%v)
|
||||
continue
|
||||
Utils.pprint("BLUE"," %s: %s"%(key,val))
|
||||
|
||||
def _getconfig(self):
|
||||
lines = []
|
||||
for key,val in sorted(self.env.get_merged_dict().items()):
|
||||
if "CLASSPATH" in key:
|
||||
lines.append(" %s:"%key)
|
||||
for v in val.split(pathsep):
|
||||
lines.append(" %s"%v)
|
||||
continue
|
||||
lines.append(" %s: %s"%(key,val))
|
||||
return "\n".join(lines)
|
||||
Build.BuildContext.getconfig = _getconfig
|
||||
|
||||
def list_targets(ctx):
|
||||
"""return the list of buildable and installable targets"""
|
||||
|
||||
bld = Build.BuildContext()
|
||||
proj = Environment.Environment(Options.lockfile)
|
||||
bld.load_dirs(proj['srcdir'], proj['blddir'])
|
||||
bld.load_envs()
|
||||
|
||||
bld.add_subdirs([os.path.split(Utils.g_module.root_path)[0]])
|
||||
|
||||
names = set([])
|
||||
for x in bld.all_task_gen:
|
||||
try:
|
||||
names.add(x.name or x.target)
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
lst = list(names)
|
||||
lst.sort()
|
||||
for name in lst:
|
||||
print(name)
|
||||
|
||||
def decorate_dist(f):
|
||||
def dist(appname='',version=''):
|
||||
'''makes a tarball for redistributing the sources -- if --skip-dist is specified, does nothing'''
|
||||
if Options.options.DONTDIST:
|
||||
if not appname: appname=Utils.g_module.APPNAME
|
||||
if not version: version=Utils.g_module.VERSION
|
||||
tmp_folder=appname+'-'+version
|
||||
if Scripting.g_gz in['gz','bz2']:
|
||||
arch_name=tmp_folder+'.tar.'+Scripting.g_gz
|
||||
else:
|
||||
arch_name=tmp_folder+'.'+'zip'
|
||||
Logs.info('New archive skipped: %s'%(arch_name))
|
||||
return arch_name
|
||||
else:
|
||||
return f(appname,version)
|
||||
return dist
|
||||
Scripting.dist = decorate_dist(Scripting.dist)
|
||||
|
||||
def dist_hook():
|
||||
# Clean the GARBAGE that clogs our repo to the tune of 300 MB
|
||||
# so downloaders won't have to cry every time they download a "source"
|
||||
# package over 90 MB in size
|
||||
[ shutil.rmtree(f) for f in _glob(_join("*","bin")) if _isdir(f) ]
|
||||
[ shutil.rmtree(f) for f in _glob(_join("cloudstack-proprietary","thirdparty","*")) if _isdir(f) ]
|
||||
[ shutil.rmtree(f) for f in [ _join("cloudstack-proprietary","tools") ] if _isdir(f) ]
|
||||
|
||||
if Options.options.OSS:
|
||||
[ shutil.rmtree(f) for f in "cloudstack-proprietary".split() if _exists(f) ]
|
||||
|
||||
stdout = svninfo("..") or allgitinfo()
|
||||
if stdout:
|
||||
f = file("sccs-info","w")
|
||||
f.write(stdout)
|
||||
f.flush()
|
||||
f.close()
|
||||
else:
|
||||
# No SVN available
|
||||
if _exists("sccs-info"):
|
||||
# If the file already existed, we preserve it
|
||||
return
|
||||
else:
|
||||
f = file("sccs-info","w")
|
||||
f.write("No revision control information could be detected when the source distribution was built.")
|
||||
f.flush()
|
||||
f.close()
|
||||
|
||||
def bindist(ctx):
|
||||
"""creates a binary distribution that, when unzipped in the root directory of a machine, deploys the entire stack"""
|
||||
ctx = _getbuildcontext()
|
||||
|
||||
if Options.options.VERNUM:
|
||||
VERSION = Options.options.VERNUM
|
||||
|
||||
tarball = "%s-bindist-%s.tar.%s"%(APPNAME,VERSION,Scripting.g_gz)
|
||||
zf = _join(ctx.bldnode.abspath(),tarball)
|
||||
Options.options.destdir = _join(ctx.bldnode.abspath(),"bindist-destdir")
|
||||
Scripting.install(ctx)
|
||||
|
||||
if _exists(zf): _unlink(zf)
|
||||
Utils.pprint("GREEN","Creating %s"%(zf))
|
||||
z = tarfile.open(zf,"w:bz2")
|
||||
cwd = _getcwd()
|
||||
_chdir(Options.options.destdir)
|
||||
z.add(".")
|
||||
z.close()
|
||||
_chdir(cwd)
|
||||
|
||||
@throws_command_errors
|
||||
def deb(context):
|
||||
raise Utils.WafError("Debian packages are no longer build with waf. Use dpkg-buildpackage instead.")
|
||||
|
||||
@throws_command_errors
|
||||
def rpm(context):
|
||||
buildnumber = Utils.getbuildnumber()
|
||||
if buildnumber: buildnumber = ["--define","_build_number %s"%buildnumber]
|
||||
else: buildnumber = []
|
||||
|
||||
if Options.options.PRERELEASE:
|
||||
if not buildnumber:
|
||||
raise Utils.WafError("Please specify a build number to go along with --prerelease")
|
||||
prerelease = ["--define","_prerelease %s"%Options.options.PRERELEASE]
|
||||
else: prerelease = []
|
||||
|
||||
if Options.options.RELEASENUM:
|
||||
release = Options.options.RELEASENUM
|
||||
else: release = "1"
|
||||
|
||||
releasever = ["--define", "_rel %s" % release]
|
||||
|
||||
if Options.options.VERNUM:
|
||||
ver = Options.options.VERNUM
|
||||
else: ver = SHORTVERSION
|
||||
|
||||
packagever = ["--define", "_ver %s" % ver]
|
||||
|
||||
# FIXME wrap the source tarball in POSIX locking!
|
||||
if not Options.options.blddir: outputdir = _join(context.curdir,blddir,"rpmbuild")
|
||||
else: outputdir = _join(_abspath(Options.options.blddir),"rpmbuild")
|
||||
Utils.pprint("GREEN","Building RPMs")
|
||||
|
||||
tarball = Scripting.dist('', ver)
|
||||
sourcedir = _join(outputdir,"SOURCES")
|
||||
|
||||
if _exists(sourcedir): shutil.rmtree(sourcedir)
|
||||
for a in ["RPMS/noarch","SRPMS","BUILD","SPECS","SOURCES"]: mkdir_p(_join(outputdir,a))
|
||||
shutil.move(tarball,_join(sourcedir,tarball))
|
||||
|
||||
specfile = "%s.spec"%APPNAME
|
||||
checkdeps = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"--nobuild",specfile]+packagever+releasever)
|
||||
dorpm = lambda: c(["rpmbuild","--define","_topdir %s"%outputdir,"-bb",specfile]+buildnumber+prerelease+packagever+releasever)
|
||||
try: checkdeps()
|
||||
except (CalledProcessError,OSError),e:
|
||||
Utils.pprint("YELLOW","Dependencies might be missing. Trying to auto-install them...")
|
||||
installrpmdeps(context)
|
||||
dorpm()
|
||||
|
||||
def uninstallrpms(context):
|
||||
"""uninstalls any Cloud Stack RPMs on this system"""
|
||||
Utils.pprint("GREEN","Uninstalling any installed RPMs")
|
||||
cmd = "rpm -qa | grep %s- | xargs -r sudo rpm -e"%APPNAME
|
||||
Utils.pprint("BLUE",cmd)
|
||||
system(cmd)
|
||||
|
||||
def viewrpmdeps(context):
|
||||
"""shows all the necessary dependencies to build the RPM packages of the stack"""
|
||||
for dep in getrpmdeps(): print dep
|
||||
|
||||
@throws_command_errors
|
||||
def installrpmdeps(context):
|
||||
"""installs all the necessary dependencies to build the RPM packages of the stack"""
|
||||
runnable = ["sudo","yum","install","-y"]+list(getrpmdeps())
|
||||
Utils.pprint("GREEN","Installing RPM build dependencies")
|
||||
Utils.pprint("BLUE"," ".join(runnable))
|
||||
_check_call(runnable)
|
||||
|
||||
@throws_command_errors
|
||||
def deploydb(ctx,virttech=None):
|
||||
if not virttech: raise Utils.WafError('use deploydb_xenserver, deploydb_vmware or deploydb_kvm rather than deploydb')
|
||||
|
||||
ctx = _getbuildcontext()
|
||||
setupdatabases = _join(ctx.env.BINDIR,"cloud-setup-databases")
|
||||
serversetup = _join(ctx.env.SETUPDATADIR,"server-setup.xml")
|
||||
|
||||
if not _exists(setupdatabases): # Needs install!
|
||||
Scripting.install(ctx)
|
||||
|
||||
cmd = [
|
||||
ctx.env.PYTHON,
|
||||
setupdatabases,
|
||||
"cloud@%s"%ctx.env.DBHOST,
|
||||
virttech,
|
||||
"--auto=%s"%serversetup,
|
||||
"--deploy-as=%s:%s"%(ctx.env.DBUSER,ctx.env.DBPW),
|
||||
]
|
||||
|
||||
Utils.pprint("BLUE"," ".join(cmd))
|
||||
retcode = Utils.exec_command(cmd,shell=False,stdout=None,stderr=None,log=True)
|
||||
if retcode: raise CalledProcessError(retcode,cmd)
|
||||
|
||||
def deploydb_xenserver(ctx):
|
||||
"""re-deploys the database using the MySQL connection information and the XenServer templates.sql"""
|
||||
return deploydb(ctx,"xenserver")
|
||||
def deploydb_kvm(ctx):
|
||||
"""re-deploys the database using the MySQL connection information and the KVM templates.sql"""
|
||||
return deploydb(ctx,"kvm")
|
||||
def deploydb_vmware(ctx):
|
||||
"""re-deploys the database using the MySQL connection information and the KVM templates.sql"""
|
||||
return deploydb(ctx,"vmware")
|
||||
|
||||
def run(args):
|
||||
"""runs the management server"""
|
||||
conf = _getbuildcontext()
|
||||
|
||||
runverbose = []
|
||||
if Options.options.RUNVERBOSE: runverbose = ['-verbose']
|
||||
if args == "debug":
|
||||
suspend = "n"
|
||||
if Options.options.DEBUGSUSPEND: suspend = "y"
|
||||
debugargs = [
|
||||
"-Xdebug","-Xrunjdwp:transport=dt_socket,address=%s,server=y,suspend=%s"%(
|
||||
Options.options.DEBUGPORT,suspend),
|
||||
"-ea"]
|
||||
Utils.pprint("GREEN","Starting Tomcat in debug mode")
|
||||
else:
|
||||
Utils.pprint("GREEN","Starting Tomcat in foreground mode")
|
||||
debugargs = []
|
||||
|
||||
options = runverbose + debugargs + [
|
||||
"-Dcatalina.base=" + conf.env.MSENVIRON,
|
||||
"-Dcatalina.home=" + conf.env.MSENVIRON,
|
||||
"-Djava.io.tmpdir="+_join(conf.env.MSENVIRON,"temp"), ]
|
||||
|
||||
if not _exists(_join(conf.env.BINDIR,"cloud-setup-databases")): Scripting.install(conf)
|
||||
|
||||
cp = [conf.env.MSCONF]
|
||||
cp += _glob(_join(conf.env.MSENVIRON,'bin',"*.jar"))
|
||||
cp += _glob(_join(conf.env.MSENVIRON,'lib',"*.jar"))
|
||||
cp += _glob( _join ( conf.env.PREMIUMJAVADIR , "*" ) )
|
||||
cp += [conf.env.SYSTEMCLASSPATH]
|
||||
cp += [conf.env.DEPSCLASSPATH]
|
||||
cp += [conf.env.MSCLASSPATH]
|
||||
|
||||
# FIXME Make selectable at runtime
|
||||
#plugins = _glob( _join(conf.env.PLUGINJAVADIR,"*") )
|
||||
#if plugins: cp = plugins + cp
|
||||
#vendorconfs = _glob( _join(conf.env.MSCONF,"vendor","*") )
|
||||
#if vendorconfs: cp = plugins + cp
|
||||
|
||||
run_java("org.apache.catalina.startup.Bootstrap",cp,options,["start"])
|
||||
|
||||
def debug(ctx):
|
||||
"""runs the management server in debug mode"""
|
||||
run("debug")
|
||||
|
||||
@throws_command_errors
|
||||
def run_agent(args):
|
||||
"""runs the agent""" # FIXME: make this use the run/debug options
|
||||
conf = _getbuildcontext()
|
||||
if not _exists(_join(conf.env.LIBEXECDIR,"agent-runner")): Scripting.install(conf)
|
||||
_check_call("sudo",[_join(conf.env.LIBEXECDIR,"agent-runner")])
|
||||
|
||||
@throws_command_errors
|
||||
#def run_console_proxy(args):
|
||||
# """runs the console proxy""" # FIXME: make this use the run/debug options
|
||||
# conf = _getbuildcontext()
|
||||
# if not _exists(_join(conf.env.LIBEXECDIR,"console-proxy-runner")): Scripting.install(conf)
|
||||
# _check_call("sudo",[_join(conf.env.LIBEXECDIR,"console-proxy-runner")])
|
||||
|
||||
def simulate_agent(args):
|
||||
"""runs the agent simulator, compiling and installing files as needed
|
||||
- Any parameter specified after the simulate_agent is appended to
|
||||
the java command line. To inhibit waf from interpreting the
|
||||
command-line options that you specify to the agent, put a --
|
||||
(double-dash) between the waf simulate_agent and the options, like this:
|
||||
|
||||
python waf simulate_agent -- -z KY -p KY
|
||||
"""
|
||||
|
||||
# to get this to work smoothly from the configure onwards, you need to
|
||||
# create an override directory in java/agent/conf, then add an agent.properties
|
||||
# there, with the correct configuration that you desire
|
||||
# that is it -- you are now ready to simulate_agent
|
||||
conf = _getbuildcontext()
|
||||
args = sys.argv[sys.argv.index("simulate_agent")+1:]
|
||||
if '--' in args: args.remove('--')
|
||||
|
||||
cp = [conf.env.AGENTSYSCONFDIR]
|
||||
cp += _glob( _join ( conf.env.PREMIUMJAVADIR , "*" ) )
|
||||
cp += [conf.env.SYSTEMCLASSPATH]
|
||||
cp += [conf.env.DEPSCLASSPATH]
|
||||
cp += [conf.env.AGENTSIMULATORCLASSPATH]
|
||||
|
||||
if not _exists(_join(conf.env.LIBEXECDIR,"agent-runner")): Scripting.install(conf)
|
||||
|
||||
run_java("com.cloud.agent.AgentSimulator",cp,arguments=args)
|
||||
|
||||
457
wscript_build
457
wscript_build
@ -1,457 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
|
||||
"""builds the entire stack"""
|
||||
#For every matching build change here, that produces new installable
|
||||
#files, the cloud.spec file and the Debian control files must be
|
||||
#revised and tested.
|
||||
|
||||
import shutil,os
|
||||
import Utils,Node,Options,Logs,Scripting,Environment,Build,Configure
|
||||
from os import unlink as _unlink, makedirs as _makedirs, getcwd as _getcwd, chdir as _chdir
|
||||
from os.path import abspath as _abspath, basename as _basename, dirname as _dirname, exists as _exists, isdir as _isdir, split as _split, join as _join, sep, pathsep, pardir, curdir
|
||||
from glob import glob as _glob
|
||||
from subprocess import Popen as _Popen,PIPE
|
||||
try: set([1,2,3])
|
||||
except Exception: from Sets import set
|
||||
import re
|
||||
import zipfile,tarfile
|
||||
import time
|
||||
try:
|
||||
from os import chmod as _chmod,chown as _chown
|
||||
import pwd,stat,grp
|
||||
except ImportError:
|
||||
_chmod,_chown,pwd,stat,grp = (None,None,None,None,None)
|
||||
|
||||
|
||||
# Global variables setup
|
||||
sourcedir = bld.srcnode.abspath()
|
||||
builddir = bld.path.abspath(bld.env)
|
||||
#buildpremium = _exists(_join(sourcedir,"cloudstack-proprietary"))
|
||||
buildpremium = False
|
||||
filelist = bld.path.ant_glob
|
||||
distdir = Utils.relpath(_join(sourcedir,"dist"))
|
||||
targetdir = Utils.relpath(_join(sourcedir,"target"))
|
||||
|
||||
def gitinfo(dir=None):
|
||||
if dir and not _isdir(dir): return ''
|
||||
try: p = _Popen(['git','remote','show','-n','origin'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir)
|
||||
except OSError,e:
|
||||
if e.errno == 2: return '' # svn command is not installed
|
||||
raise
|
||||
stdout,stderr = p.communicate('')
|
||||
retcode = p.wait()
|
||||
# If the guess fails, just return nothing.
|
||||
if retcode: return
|
||||
stdout = [ s.strip() for s in stdout.splitlines() ]
|
||||
try: url = [ s[11:] for s in stdout if s.startswith("Fetch URL") ][0]
|
||||
except IndexError: url = [ s[5:] for s in stdout if s.startswith("URL") ][0]
|
||||
assert url
|
||||
|
||||
p = _Popen(['git','log','-1'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir)
|
||||
stdout,stderr = p.communicate('')
|
||||
retcode = p.wait()
|
||||
if retcode: return
|
||||
# If the guess fails, just return nothing.
|
||||
stdout = [ s.strip() for s in stdout.splitlines() ]
|
||||
commitid = [ s.split()[1] for s in stdout if s.startswith("commit") ][0]
|
||||
assert commitid
|
||||
|
||||
return "Git Revision: %s"%commitid + "\n" + "Git URL: %s"%url + "\n"
|
||||
|
||||
def build_utils_docs ():
|
||||
stdout = gitinfo()
|
||||
if stdout:
|
||||
f = file("sccs-info","w")
|
||||
f.write(stdout)
|
||||
f.flush()
|
||||
f.close()
|
||||
else:
|
||||
if _exists("sccs-info"):
|
||||
# If the file already existed, we preserve it
|
||||
return
|
||||
else:
|
||||
f = file("sccs-info","w")
|
||||
f.write("No revision control information could be detected when the source distribution was built.")
|
||||
f.flush()
|
||||
f.close()
|
||||
|
||||
sccsinfo = _join(sourcedir,"sccs-info")
|
||||
if _exists(sccsinfo): bld.install_files("${DOCDIR}","sccs-info")
|
||||
|
||||
tgen = bld(features='subst', name='configure-info', source="configure-info.in", target="configure-info")
|
||||
tgen.dict = {"CONFIGUREVARS":bld.getconfig()}
|
||||
bld.install_files("${DOCDIR}","configure-info")
|
||||
|
||||
# compile jar files using ant
|
||||
# ant only needs to be reinvoked if the version with build number changes
|
||||
# we here trim all the depended targets from the target list:
|
||||
def build_jars ():
|
||||
Implementation_Version = bld.env.VERSION
|
||||
|
||||
# this is to trigger recompilation / cache avoidance if the relevant environment for ant changes
|
||||
ant_args = [
|
||||
"build-all",
|
||||
"-Dimpl.version=%s" % Implementation_Version,
|
||||
"-Dtarget.dir=%s" % targetdir,
|
||||
"-Ddist.dir=%s" % distdir,
|
||||
"-Dbase.dir=%s" % sourcedir,
|
||||
"-f %s" % Utils.relpath (_join(sourcedir, "build.xml")),
|
||||
]
|
||||
|
||||
if buildpremium:
|
||||
ant_args.append("-Dbuild.premium=true")
|
||||
|
||||
tgen = bld(features='subst', name='version-info', source="version-info.in", target="version-info")
|
||||
tgen.dict = { "Implementation_Version":Implementation_Version,"ant_args":ant_args }
|
||||
bld.install_files("${DOCDIR}","version-info")
|
||||
|
||||
bld.srcnode.ensure_dir_node_from_path("target/jar")
|
||||
bld.srcnode.ensure_dir_node_from_path("dist")
|
||||
|
||||
tgen = bld.new_task_gen (rule = Utils.runant,
|
||||
name = "runant",
|
||||
antargs = ant_args)
|
||||
|
||||
jarnode = bld.srcnode.find_dir ('target/jar')
|
||||
jars_str = jarnode.ant_glob ('*.jar').split ()
|
||||
ant_jars = []
|
||||
excludes = ["cloud-xstream-1.3.1.jar", "cloud-commons-dbcp-1.2.2.jar",
|
||||
"cloud-commons-httpclient-3.1.jar", "cloud-commons-pool-1.4.jar",
|
||||
"cloud-servlet-api.jar", "cloud-commons-logging-1.1.1.jar",
|
||||
"cloud-ws-commons-util-1.0.2.jar",
|
||||
"cloud-commons-collections-3.2.1.jar", "vmware*.jar", "cloud-secstorage-extras.jar",
|
||||
"cloud-agent-simulator.jar", "cloud-awsapi.jar", "cloud-test.jar", "cloud-wsdl4j.jar", "cloud-console-proxy.jar"]
|
||||
|
||||
for a in jars_str:
|
||||
if _basename (a).startswith ("cloud-") \
|
||||
and not _basename (a) in excludes:
|
||||
a = jarnode.abspath () + os.sep + a
|
||||
ant_jars.append (a)
|
||||
|
||||
bld.install_files ('${JAVADIR}', ant_jars)
|
||||
|
||||
|
||||
def build_premium ():
|
||||
if buildpremium: bld.recurse(["cloudstack-proprietary/"],'build')
|
||||
|
||||
def build_thirdparty_dir ():
|
||||
start_path = bld.path.find_dir ("thirdparty")
|
||||
bld.install_files('${PREMIUMJAVADIR}','*.jar', cwd = start_path)
|
||||
Utils.pprint ("GREEN", "Installed files of thirdparty/")
|
||||
|
||||
def build_dependences ():
|
||||
excludes = ["cloud-xstream-1.3.1.jar", "cloud-servlet-api.jar", "cloud-commons-logging-1.1.1.jar",
|
||||
"cloud-ws-commons-util-1.0.2.jar",
|
||||
"cloud-commons-collections-3.2.1.jar", "cloud-wsdl4j.jar"]
|
||||
|
||||
start_path = bld.path.find_dir ("deps")
|
||||
|
||||
bld.install_files('${JAVADIR}',start_path.ant_glob(["CAStorSDK-*.jar", "javax.persistence-2.0.0.jar", "apache-log4j-extras-1.1.jar", "libvirt-0.4.9.jar", "axis2-1.5.1.jar", "jstl-1.2.jar", "commons-discovery-0.5.jar", "commons-codec-1.6.jar", "ejb-api-3.0.jar", "xmlrpc-client-3.1.3.jar", "commons-dbcp-1.4.jar", "commons-pool-1.6.jar", "gson-1.7.1.jar",
|
||||
"netscaler-1.0.jar", "netscaler-sdx-1.0.jar", "backport-util-concurrent-3.1.jar", "ehcache-1.5.0.jar", "httpcore-4.0.jar", "log4j-1.2.16.jar", "trilead-ssh2-build213-svnkit-1.3-patch.jar", "cglib-nodep-2.2.2.jar", "xmlrpc-common-3.*.jar",
|
||||
"axiom*.jar", "axis2*.jar", "antlr*.jar", "XmlSchema*.jar", "json-simple*.jar", "neethi*.jar", "woden*.jar", "xercesImpl*.jar", "xml-apis*.jar", "dom4j*.jar", "javassist*.jar", "commons-fileupload*.jar",
|
||||
"xmlrpc-client-3.*.jar", "wsdl4j-1.6.2.jar", "bcprov-jdk16-1.45.jar", "jsch-0.1.42.jar", "jasypt-1.9.0.jar", "commons-configuration-1.8.jar", "mail-1.4.jar", "activation-1.1.jar", "xapi-5.6.100-1-SNAPSHOT.jar"], excl = excludes), cwd=start_path)
|
||||
|
||||
#def build_console_proxy ():
|
||||
# binary unsubstitutable files:
|
||||
# start_path = bld.path.find_dir ("console-proxy")
|
||||
# bld.install_files("${CPLIBDIR}",start_path.ant_glob("images/**",src=True,bld=False,dir=False,flat=True),cwd=start_path,relative_trick=True)
|
||||
|
||||
# text substitutable files (substitute with tokens from the environment bld.env):
|
||||
# bld.substitute('css/** js/** ui/** scripts/**',install_to="${CPLIBDIR}", cwd=start_path)
|
||||
|
||||
# config files (do not replace them if preserve config option is true)
|
||||
# if not Options.options.PRESERVECONFIG: bld.install_files_filtered("${CPSYSCONFDIR}","conf.dom0/*", cwd=start_path)
|
||||
|
||||
def build_patches ():
|
||||
# done here because the patches require substituted files
|
||||
start_path = bld.path.find_dir ("patches")
|
||||
bld.substitute("*/**",name="patchsubst", cwd = start_path)
|
||||
|
||||
for virttech in Utils.to_list(start_path.ant_glob("*",dir=True)):
|
||||
if virttech in ["shared"]: continue
|
||||
patchfiles = start_path.ant_glob('shared/** %s/debian/config/**'%virttech,src=False,bld=True,dir=False,flat=True)
|
||||
tmp = bld.path
|
||||
bld.path = start_path
|
||||
tgen = bld(
|
||||
features = 'tar',#Utils.tar_up,
|
||||
source = patchfiles,
|
||||
target = 'cloud-scripts.tgz',
|
||||
name = 'cloud-scripts_tgz',
|
||||
root = os.path.join("patches", virttech + "/debian/config"),
|
||||
rename = lambda x: re.sub(".subst$","",x),
|
||||
)
|
||||
bld.path = tmp
|
||||
|
||||
|
||||
def build_systemvm_patch ():
|
||||
if bld.env.DISTRO not in ["Windows","Mac"]:
|
||||
# patch creation
|
||||
bld.install_files ("${COMMONLIBDIR}/vms", "%s/systemvm.zip" % distdir)
|
||||
# ISO creation
|
||||
bld.install_as("${COMMONLIBDIR}/vms/systemvm.iso", "%s/systemvm.iso" % distdir)
|
||||
|
||||
def build_systemvm_iso ():
|
||||
if buildpremium:
|
||||
bld.install_as("${AGENTLIBDIR}/vms/systemvm-premium.iso", "%s/systemvm-premium.iso" % distdir)
|
||||
|
||||
# =================== Empty directory / symlink creation on install target ====================
|
||||
|
||||
def build_dirs_symlinks ():
|
||||
bld.createuser(bld.env.MSUSER,bld.env.MSENVIRON,'/bin/sh')
|
||||
|
||||
# 7. make log and cache dirs (this actually runs first)
|
||||
if bld.env.DISTRO in 'Windows Mac': pass
|
||||
else:
|
||||
x = ("root",bld.env.MSUSER)
|
||||
directories = [
|
||||
("${MSLOGDIR}",0770,x),
|
||||
("${AGENTLOGDIR}",0770,x),
|
||||
("${USAGELOGDIR}",0770,x),
|
||||
# ("${CPLOGDIR}",0770,x),
|
||||
("${IPALLOCATORLOGDIR}",0770,x),
|
||||
("${LOCALSTATEDIR}/cache/${MSPATH}",0770,x),
|
||||
("${LOCALSTATEDIR}/cache/${MSPATH}/temp",0770,x),
|
||||
("${LOCALSTATEDIR}/cache/${MSPATH}/work",0770,x),
|
||||
("${SHAREDSTATEDIR}/${MSPATH}",0770,x),
|
||||
("${MSMNTDIR}",0770,x),
|
||||
("${MSCONF}/Catalina",0770,x),
|
||||
("${MSCONF}/Catalina/localhost",0770,x),
|
||||
("${MSCONF}/Catalina/localhost/client",0770,x),
|
||||
("${PIDDIR}",0755,("root","root")),
|
||||
("${LOCKDIR}",0755,("root","root")),
|
||||
]
|
||||
|
||||
for a,mode,owner in directories:
|
||||
s = bld.subst_add_destdir(a,bld)
|
||||
if Options.is_install:
|
||||
bld.install_dir(a)
|
||||
bld.setownership(a,owner[0],owner[1],mode)
|
||||
|
||||
# 8. create environment symlinks
|
||||
symlinks = [
|
||||
('${MSENVIRON}/bin', '${TOMCATHOME}/bin'),
|
||||
('${MSENVIRON}/lib', '${TOMCATHOME}/lib'),
|
||||
('${MSENVIRON}/logs', "${MSLOGDIR}"),
|
||||
('${MSENVIRON}/temp', '${LOCALSTATEDIR}/cache/${MSPATH}/temp'),
|
||||
('${MSENVIRON}/work','${LOCALSTATEDIR}/cache/${MSPATH}/work'),
|
||||
('${MSENVIRON}/conf', '${SYSCONFDIR}/${MSPATH}'),
|
||||
# ("${AGENTLIBDIR}/css", '${CPLIBDIR}/css'),
|
||||
# ("${AGENTLIBDIR}/images", '${CPLIBDIR}/images'),
|
||||
# ("${AGENTLIBDIR}/js", '${CPLIBDIR}/js'),
|
||||
# ("${AGENTLIBDIR}/ui", '${CPLIBDIR}/ui'),
|
||||
("${MSCONF}/server.xml", '${MSCONF}/server-nonssl.xml'),
|
||||
("${MSCONF}/tomcat6.conf", '${MSCONF}/tomcat6-nonssl.conf'),
|
||||
]
|
||||
|
||||
for lnk,dst in symlinks: bld.symlink_as(lnk,Utils.subst_vars(dst,bld.env))
|
||||
|
||||
|
||||
def build_scripts ():
|
||||
start_path = bld.path.find_dir ("scripts")
|
||||
bld.substitute('**',"${COMMONLIBDIR}/scripts",chmod=0755, cwd=start_path)
|
||||
|
||||
def build_bin_exec_dirs ():
|
||||
#bld.install_files_filtered("${LIBEXECDIR}","*/libexec/* cloudstack-proprietary/*/libexec/*",chmod=0755)
|
||||
#bld.install_files_filtered("${BINDIR}","*/bindir/* cloudstack-proprietary/*/bindir/*",chmod=0755)
|
||||
#bld.install_files_filtered("${SBINDIR}","*/sbindir/* cloudstack-proprietary/*/sbindir/*",chmod=0755)
|
||||
|
||||
bld.install_files_filtered("${LIBEXECDIR}","*/libexec/*",chmod=0755)
|
||||
bld.install_files_filtered("${BINDIR}","*/bindir/*",chmod=0755)
|
||||
bld.install_files_filtered("${SBINDIR}","*/sbindir/*",chmod=0755)
|
||||
|
||||
def build_server_client ():
|
||||
start_path = bld.path.find_dir("client/WEB-INF")
|
||||
bld.install_files('${MSENVIRON}/webapps/client/WEB-INF',
|
||||
start_path.ant_glob("**",src=True,bld=False,dir=False,flat=True),
|
||||
cwd=start_path,relative_trick=True)
|
||||
|
||||
start_path = bld.path.find_dir("client")
|
||||
bld.install_files("${MSCONF}/resources",'WEB-INF/classes/resources/*.properties',chmod=0640, cwd=start_path)
|
||||
|
||||
if not Options.options.PRESERVECONFIG:
|
||||
bld.install_files_filtered("${MSCONF}","tomcatconf/*", cwd=start_path)
|
||||
bld.install_files("${MSCONF}",'tomcatconf/db.properties',chmod=0640, cwd=start_path)
|
||||
bld.setownership("${MSCONF}/db.properties","root",bld.env.MSUSER)
|
||||
|
||||
start_path = bld.path.find_dir("server")
|
||||
if not Options.options.PRESERVECONFIG:
|
||||
bld.install_files_filtered("${SERVERSYSCONFDIR}","conf/*", cwd=start_path)
|
||||
|
||||
def build_agent ():
|
||||
start_path = bld.path.find_dir ("agent")
|
||||
bld.install_files("${AGENTLIBDIR}",
|
||||
start_path.ant_glob("storagepatch/**",src=True,bld=False,dir=False,flat=True),
|
||||
cwd=start_path,relative_trick=True)
|
||||
if not Options.options.PRESERVECONFIG:
|
||||
bld.install_files_filtered("${AGENTSYSCONFDIR}","conf/*", cwd = start_path)
|
||||
|
||||
def build_ui ():
|
||||
# binary unsubstitutable files:
|
||||
start_path = bld.path.find_dir ("ui")
|
||||
bld.install_files ("${MSENVIRON}/webapps/client",start_path.ant_glob("*.ico **/*png **/*jpg **/*gif",src=True,bld=False,dir=False,flat=True),cwd=start_path,relative_trick=True)
|
||||
|
||||
# text substitutable files (substitute with tokens from the environment bld.env):
|
||||
bld.substitute ("*html **/*html **/*js **/*css **/*properties **/*jsp *jsp",install_to="${MSENVIRON}/webapps/client", cwd=start_path)
|
||||
|
||||
def build_conf_files ():
|
||||
# apply distro-specific config on top of the 'all' generic cloud-management config
|
||||
globspec = _join("*","distro",bld.env.DISTRO.lower(),"*") # matches premium/distro/centos/SYSCONFDIR
|
||||
#distrospecificdirs=_glob(globspec) + _glob(_join("cloudstack-proprietary",globspec))
|
||||
distrospecificdirs=_glob(globspec)
|
||||
for dsdir in distrospecificdirs:
|
||||
start_path = bld.srcnode.find_dir(dsdir)
|
||||
subpath,varname = _split(dsdir)
|
||||
dsdirwithvar = _join("${%s}"%varname)
|
||||
files = filelist('%s/**'%dsdir,src=True,bld=False,dir=False,flat=True)
|
||||
mode = 0644
|
||||
if "SYSCONFDIR" in dsdir:
|
||||
mode = 0755
|
||||
if Options.options.PRESERVECONFIG: continue
|
||||
bld.install_files_filtered(dsdirwithvar, files, cwd=start_path, relative_trick=True,chmod=mode)
|
||||
|
||||
# cloudstack-proprietary still has db files for usage
|
||||
def build_db_files ():
|
||||
#bld.install_files_filtered("${SETUPDATADIR}",filelist("*/db/* cloudstack-proprietary/*/db/*",excl=Node.exclude_regs + "\ncloud-gate\ncloud-bridge"))
|
||||
start_path = bld.path.find_dir ("setup/db")
|
||||
bld.substitute('**',"${SETUPDATADIR}", cwd=start_path)
|
||||
if buildpremium:
|
||||
start_path = bld.path.find_dir ("cloudstack-proprietary/premium/db")
|
||||
bld.substitute('**',"${SETUPDATADIR}", cwd=start_path)
|
||||
|
||||
|
||||
def build_plugins ():
|
||||
# ====================== Feature-specific plugins ========================
|
||||
|
||||
for plugin in _glob(_join("plugins","*")) + _glob(_join("cloudstack-proprietary","plugins","*")):
|
||||
if not _exists(_join(plugin,"build.xml")): continue
|
||||
pluginname = _basename(plugin)
|
||||
target = 'target/jar/cloud-%s.jar' % pluginname
|
||||
sources = filelist( '%s/**/*.java' % plugin.replace(sep,"/") , src=True, bld=False, dir=False )
|
||||
tgen = bld(rule=lambda x: runant("compile-%s"%pluginname), name='compile_%s'%pluginname, source=sources, target=target, after='runant')
|
||||
bld.install_files('${PLUGINJAVADIR}',target)
|
||||
|
||||
# ====================== End feature-specific plugins ====================
|
||||
|
||||
|
||||
# ====================== Vendor-specific plugins ========================
|
||||
|
||||
for vendor in _glob(_join("vendor","*")) + _glob(_join("cloudstack-proprietary","vendor","*")):
|
||||
if not Options.options.PRESERVECONFIG:
|
||||
bld.install_files_filtered("${MSCONF}/%s"%vendor,filelist("%s/tomcatconf/*"%vendor))
|
||||
|
||||
# ====================== End vendor-specific plugins ====================
|
||||
|
||||
def build_xml_api_description ():
|
||||
def generate_xml_api_description(task):
|
||||
relationship = Utils.relpath(sourcedir,os.getcwd())
|
||||
cp = [ _join(relationship,x) for x in task.generator.env.CLASSPATH.split(pathsep) ]
|
||||
|
||||
jarnames = ['utils','server','core', 'api', 'server-extras']
|
||||
props = ["client/tomcatconf/commands.properties.in"]
|
||||
|
||||
sources = []
|
||||
for i in jarnames:
|
||||
str = 'target/jar/cloud-%s.jar' % i
|
||||
sources.append (str)
|
||||
sources.append ("client/tomcatconf/commands.properties.in")
|
||||
if buildpremium:
|
||||
sources.append("client/tomcatconf/commands-ext.properties.in")
|
||||
|
||||
buildproducts = []
|
||||
for i in sources:
|
||||
path = bld.path.abspath() + os.sep + i
|
||||
buildproducts.append (path)
|
||||
|
||||
jars = [ x for x in buildproducts if x.endswith("jar") ]
|
||||
properties = [ x for x in buildproducts if x.endswith("properties.in") ]
|
||||
cp += jars
|
||||
cp = pathsep.join(cp)
|
||||
arguments = ["-f",",".join(properties),"-d",builddir]
|
||||
ret = Utils.exec_command(["java","-cp",cp,"com.cloud.api.doc.ApiXmlDocWriter"]+arguments,log=True)
|
||||
return ret
|
||||
|
||||
#TODO: We can't use 'source' token here because task_gen check if sources
|
||||
# exist before all task_gen. This bring a problem that 'runant' task doesn't
|
||||
# run when the check happen, which results in no source found at target/jar.
|
||||
# Ask waf community to fix that
|
||||
tgen = bld.new_task_gen (
|
||||
rule = generate_xml_api_description,
|
||||
target = 'commands.xml',
|
||||
name = 'xmlapi',
|
||||
after = 'runant',
|
||||
install_path="${CLIDIR}"
|
||||
)
|
||||
|
||||
bld.install_as("${PYTHONDIR}/cloud_utils.py", 'python/lib/cloud_utils.py')
|
||||
bld.install_files("${PYTHONDIR}/cloudtool", 'cloud-cli/cloudtool/*')
|
||||
bld.install_files("${PYTHONDIR}/cloudutils", 'python/lib/cloudutils/*')
|
||||
bld.install_as("${PYTHONDIR}/cloudapis.py", 'cloud-cli/cloudapis/cloud.py')
|
||||
|
||||
def build_ovm():
|
||||
start_path = bld.path.find_dir("plugins/hypervisors/ovm/scripts")
|
||||
bld.substitute('**',"${COMMONLIBDIR}/scripts",chmod=0755, cwd=start_path)
|
||||
|
||||
def build_test():
|
||||
start_path = bld.path.find_dir("test/scripts")
|
||||
bld.install_files('${LIBDIR}/${PACKAGE}/test', \
|
||||
start_path.ant_glob("**",src=True,bld=False,dir=False,flat=True), \
|
||||
cwd=start_path,relative_trick=True)
|
||||
|
||||
start_path = bld.path.find_dir("test/metadata")
|
||||
bld.install_files('${SHAREDSTATEDIR}/${PACKAGE}/test', \
|
||||
start_path.ant_glob("**",src=True,bld=False,dir=False,flat=True), \
|
||||
cwd=start_path,relative_trick=True)
|
||||
|
||||
if not Options.options.PRESERVECONFIG:
|
||||
start_path = bld.path.find_dir("test")
|
||||
bld.install_files('${SYSCONFDIR}/${PACKAGE}/test','conf/*', cwd = start_path)
|
||||
Utils.pprint ("GREEN", "Installed files of test/")
|
||||
|
||||
def build_usage_dir ():
|
||||
start_path = bld.path.find_dir ("usage")
|
||||
bld.install_files_filtered("${USAGESYSCONFDIR}","conf/*", cwd = start_path)
|
||||
bld.symlink_as("${USAGESYSCONFDIR}/db.properties", \
|
||||
Utils.subst_vars("${MSCONF}/db.properties",bld.env))
|
||||
Utils.pprint ("GREEN", "Installed files of usage/")
|
||||
|
||||
|
||||
# Get started to execute here
|
||||
#build_utils_docs ()
|
||||
build_jars ()
|
||||
build_premium ()
|
||||
#build_thirdparty_dir()
|
||||
build_dependences ()
|
||||
#build_patches ()
|
||||
build_systemvm_patch ()
|
||||
build_dirs_symlinks ()
|
||||
build_scripts ()
|
||||
build_bin_exec_dirs ()
|
||||
build_server_client ()
|
||||
build_agent ()
|
||||
build_ui ()
|
||||
build_conf_files ()
|
||||
build_db_files ()
|
||||
build_plugins ()
|
||||
build_xml_api_description ()
|
||||
build_ovm ()
|
||||
#build_test()
|
||||
build_usage_dir()
|
||||
|
||||
# ====================== Magic! =========================================
|
||||
bld.use_the_magic()
|
||||
@ -1,408 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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.
|
||||
|
||||
"""examines environment, then:
|
||||
- configures classpath as per environment or command-line options
|
||||
- detects Tomcat (on Windows)
|
||||
- detects or configures directories according to command-line options"""
|
||||
|
||||
import Utils,Node,Options,Logs,Scripting,Environment,Build,Configure
|
||||
from os import unlink as _unlink, makedirs as _makedirs, getcwd as _getcwd, chdir as _chdir
|
||||
try: from os import getuid as _getuid
|
||||
except ImportError: pass
|
||||
from os.path import abspath as _abspath, basename as _basename, dirname as _dirname, exists as _exists, isdir as _isdir, split as _split, join as _join, expanduser as _expanduser, sep, pathsep, pardir
|
||||
from glob import glob as _glob
|
||||
import time
|
||||
|
||||
|
||||
# list of JARs that provide the build dependencies
|
||||
# "j" generally means /usr/share/java
|
||||
# when adding a new system JAR file:
|
||||
# 1. check the hard_deps variable at the bottom and add the appropriate packaging information,
|
||||
# 2. add the RPM package that contains the jarfile into the cloud.spec file, and the DEB package into the debian/control file
|
||||
# 3. (the jars specified here will be looked up at runtime with build-classpath, on linux installs)
|
||||
systemjars = {
|
||||
'common':
|
||||
(
|
||||
"commons-collections.jar",
|
||||
# "commons-daemon.jar",
|
||||
#"commons-dbcp.jar",
|
||||
"commons-codec.jar",
|
||||
"commons-logging.jar",
|
||||
"commons-logging-api.jar",
|
||||
#"commons-pool.jar",
|
||||
"commons-httpclient.jar",
|
||||
"ws-commons-util.jar",
|
||||
"mysql-connector-java.jar",
|
||||
),
|
||||
'Fedora':
|
||||
(
|
||||
"tomcat6-servlet-2.5-api.jar",
|
||||
"tomcat6-el-2.1-api-6.0.26.jar",
|
||||
"tomcat6-jsp-2.1-api-6.0.26.jar",
|
||||
#"tomcat6/catalina.jar", # all supported distros put the file there
|
||||
),
|
||||
'RHEL':
|
||||
(
|
||||
"tomcat6-servlet-2.5-api.jar",
|
||||
"tomcat6-el-2.1-api-6.0.24.jar",
|
||||
"tomcat6-jsp-2.1-api-6.0.24.jar",
|
||||
"jakarta-taglibs-core-1.1.1.jar",
|
||||
"jakarta-taglibs-standard-1.1.1.jar",
|
||||
"tomcat6/jasper.jar",
|
||||
"tomcat6/jasper-el.jar",
|
||||
"tomcat6/jasper-jdt.jar",
|
||||
|
||||
),
|
||||
'CentOS':
|
||||
(
|
||||
"tomcat6-servlet-2.5-api.jar",
|
||||
"tomcat6-jsp-2.1-api-6.0.24.jar",
|
||||
"tomcat6-el-2.1-api-6.0.24.jar",
|
||||
"jakarta-taglibs-core-1.1.1.jar",
|
||||
"jakarta-taglibs-standard-1.1.1.jar",
|
||||
"tomcat6/jasper.jar",
|
||||
"tomcat6/jasper-el.jar",
|
||||
"tomcat6/jasper-jdt.jar",
|
||||
#"tomcat6/catalina.jar", # all supported distros put the file there
|
||||
),
|
||||
'Ubuntu':
|
||||
(
|
||||
"servlet-api-2.5.jar",
|
||||
"jsp-api-2.1.jar",
|
||||
"jasper.jar",
|
||||
"el-api-2.1.jar",
|
||||
"jasper-el.jar",
|
||||
"ecj.jar",
|
||||
"cglib.jar",
|
||||
"asm3.jar",
|
||||
"jsch.jar",
|
||||
"backport-util-concurrent.jar",
|
||||
"jetty.jar",
|
||||
"jetty-util.jar",
|
||||
"jetty-start-daemon.jar",
|
||||
"jetty-sslengine.jar",
|
||||
"jetty-start.jar",
|
||||
"jna.jar",
|
||||
"log4j-1.2.jar",
|
||||
),
|
||||
'Windows':
|
||||
(
|
||||
"servlet-api.jar", # this ships with Tomcat in lib/
|
||||
#"catalina.jar",
|
||||
),
|
||||
'Mac':
|
||||
(
|
||||
"servlet-api.jar",
|
||||
),
|
||||
'openSUSE':
|
||||
(
|
||||
"tomcat6-servlet-2.5-api.jar",
|
||||
"tomcat6-jsp-2.1-api-6.0.24.jar",
|
||||
"tomcat6-el-1.0-api.jar"
|
||||
),
|
||||
'SLES':
|
||||
(
|
||||
"tomcat6-servlet-2.5-api.jar",
|
||||
"tomcat6-jsp-2.1-api-6.0.24.jar",
|
||||
"tomcat6-el-1.0-api.jar"
|
||||
)
|
||||
}
|
||||
|
||||
#A JAR dependency may be:
|
||||
|
||||
#- required during compile-time
|
||||
#- required during run-time
|
||||
|
||||
#A JAR file can be available:
|
||||
|
||||
#- in Tomcat lib/
|
||||
#- as a Linux system package
|
||||
#- in the cloud-deps package
|
||||
#- in the cloud-premium package
|
||||
|
||||
# servlet-api:
|
||||
|
||||
#- is required during compile-time
|
||||
#- is required during management server run-time
|
||||
#- is available in Tomcat lib/ (Windows/Mac) AND as a system package (Linux)
|
||||
# -> ERGO, we do not need to include it
|
||||
# but it should be named on the SYSTEMJARS (which is then used in the tomcat6.conf to build the MS classpath),
|
||||
# and it should also be in the compile-time CLASSPATH
|
||||
|
||||
# =====================================
|
||||
|
||||
# list of dependencies for configure check
|
||||
# (classname,fedora package name,ubuntu package name)
|
||||
# when adding a package name here, also add to the spec or debian control file
|
||||
hard_deps = [
|
||||
('java.io.FileOutputStream',"java-devel","openjdk-6-jdk"),
|
||||
('javax.servlet.http.Cookie',"tomcat6-servlet-2.5-api","libservlet2.5-java","(if on Windows,did you set TOMCAT_HOME to point to your Tomcat setup?)"),
|
||||
('org.apache.naming.resources.Constants',"tomcat6-lib","libtomcat6-java","(if on Windows,did you set TOMCAT_HOME to point to your Tomcat setup?)"),
|
||||
]
|
||||
|
||||
|
||||
if Options.options.VERNUM:
|
||||
Version = Options.options.VERNUM
|
||||
else:
|
||||
Version = "2.2"
|
||||
builddate = time.strftime("%Y.%m.%d.%H.%M.%S", time.localtime()).replace('.','')
|
||||
conf.env.VERSION = Version + "." + builddate
|
||||
|
||||
conf.check_message_1('Detecting distribution')
|
||||
if Options.platform == 'win32': conf.env.DISTRO = "Windows"
|
||||
elif Options.platform == 'darwin': conf.env.DISTRO = "Mac"
|
||||
elif _exists("/etc/network"): conf.env.DISTRO = "Ubuntu"
|
||||
elif _exists("/etc/fedora-release"): conf.env.DISTRO = "Fedora"
|
||||
elif _exists("/etc/centos-release"): conf.env.DISTRO = "CentOS"
|
||||
elif _exists("/etc/redhat-release"):
|
||||
version = file("/etc/redhat-release").readline()
|
||||
if version.find("Red Hat Enterprise Linux Server release 6") != -1:
|
||||
conf.env.DISTRO = "RHEL"
|
||||
elif version.find("CentOS release") != -1:
|
||||
conf.env.DISTRO = "CentOS"
|
||||
elif _exists("/etc/SuSE-release"):
|
||||
content = file("/etc/SuSE-release").readlines()
|
||||
supportedVersion = None
|
||||
if content[0].find("SUSE Linux Enterprise Server 11") != -1:
|
||||
spLevel = eval(content[-1].split()[-1])
|
||||
if spLevel >= 2:
|
||||
conf.env.DISTRO = "SLES"
|
||||
supportedVersion = 1
|
||||
elif content[0].find("openSUSE") != -1:
|
||||
version = eval(content[1].split()[-1])
|
||||
if version >= 12.1:
|
||||
conf.env.DISTRO = "openSUSE"
|
||||
supportedVersion = 1
|
||||
if not supportedVersion:
|
||||
conf.env.DISTRO = "unknown"
|
||||
else: conf.env.DISTRO = "unknown"
|
||||
if conf.env.DISTRO == "unknown": c = "YELLOW"
|
||||
else: c = "GREEN"
|
||||
conf.check_message_2(conf.env.DISTRO,c)
|
||||
conf.check_message_1('Detecting installation prefix')
|
||||
if Options.options.prefix == Options.default_prefix:
|
||||
if conf.env.DISTRO == 'Windows':
|
||||
conf.env.PREFIX = 'C:\\CloudStack'
|
||||
elif _getuid() != 0: # not root
|
||||
conf.env.PREFIX = _join(_expanduser("~"),"cloudstack")
|
||||
conf.check_message_2("%s"%conf.env.PREFIX,"GREEN")
|
||||
|
||||
conf.check_tool('misc')
|
||||
|
||||
conf.check_tool("gnu_dirs")
|
||||
if conf.env.DISTRO == 'Windows':
|
||||
# waf uses slashes somewhere along the line in some paths. we fix them on windows.
|
||||
for pth in [ x for x in conf.env.get_merged_dict().keys() if x.endswith("DIR") ]:
|
||||
if not pth: continue
|
||||
if not conf.env[pth]: continue
|
||||
conf.env[pth] = conf.env[pth].replace("/","\\")
|
||||
|
||||
conf.check_tool('tar')
|
||||
try: conf.check_tool('mkisofs')
|
||||
except Configure.ConfigurationError,e:
|
||||
raise Configure.ConfigurationError, "The program genisoimage (or mkisofs) could not be found.\nOn Linux: ./waf installrpmdeps or ./waf installdebdeps according to your distro's package format.\nOn Windows: Use cygwin to install the mkisofs package, then ensure that the program is in your PATH."
|
||||
conf.check_tool('java')
|
||||
|
||||
conf.check_tool("python")
|
||||
conf.check_python_version((2,4,0))
|
||||
|
||||
conf.check_message_1('Detecting Python MySQL module')
|
||||
try: import MySQLdb
|
||||
except ImportError,e:
|
||||
raise Configure.ConfigurationError, "The Python MySQLdb module could not be found.\nOn Linux: ./waf installrpmdeps or ./waf installdebdeps according to your distro's package format.\nOn Windows: Install MySQL 5.1 on your machine, then install the Python MySQLdb module for Python %s.\nThe module for Python 2.6 / win32 / MySQL 5.1 is available here: http://soemin.googlecode.com/files/MySQL-python-1.2.3c1.win32-py2.6.exe"%conf.env.PYTHON_VERSION
|
||||
conf.check_message_2('MySQLdb','GREEN')
|
||||
conf.check_message_1('Database info for developer setup')
|
||||
for a in "DBHOST DBUSER DBPW".split(): conf.env[a] = getattr(Options.options, a, '')
|
||||
conf.check_message_2("user: %r, password: %r, host: %r"%(conf.env.DBUSER,conf.env.DBPW,conf.env.DBHOST),'GREEN')
|
||||
|
||||
try: conf.check_tool("tomcat")
|
||||
except Configure.ConfigurationError,e:
|
||||
conf.fatal("Tomcat directory %r not found. Either install Tomcat using ./waf installrpmdeps or ./waf installdebdeps, or manually install Tomcat to a directory in your system and set the environment variable TOMCAT_HOME to point to it."%conf.env.TOMCATHOME)
|
||||
|
||||
conf.env.COMMONPATH = _join(conf.env.PACKAGE,"common")
|
||||
conf.env.AGENTPATH = _join(conf.env.PACKAGE,"agent")
|
||||
conf.env.CPPATH = _join(conf.env.PACKAGE,"console-proxy")
|
||||
conf.env.IPALLOCATORPATH = _join(conf.env.PACKAGE,"ipallocator")
|
||||
conf.env.MSPATH = _join(conf.env.PACKAGE,"management")
|
||||
conf.env.USAGEPATH = _join(conf.env.PACKAGE,"usage")
|
||||
conf.env.SETUPPATH = _join(conf.env.PACKAGE,"setup")
|
||||
conf.env.SERVERPATH = _join(conf.env.PACKAGE,"server")
|
||||
|
||||
if conf.env.DISTRO in ['Windows','Mac']:
|
||||
conf.env.MSENVIRON = conf.env.TOMCATHOME
|
||||
conf.env.MSCONF = _join(conf.env.TOMCATHOME,"conf")
|
||||
conf.env.MSLOGDIR = _join(conf.env.TOMCATHOME,"logs")
|
||||
conf.env.MSMNTDIR = _join(conf.env.TOMCATHOME,"mnt")
|
||||
conf.env.JAVADIR = _join(conf.env.MSENVIRON,"lib")
|
||||
conf.env.PREMIUMJAVADIR = conf.env.JAVADIR
|
||||
conf.env.PLUGINJAVADIR = conf.env.JAVADIR
|
||||
conf.env.SYSTEMJAVADIR = conf.env.JAVADIR
|
||||
else:
|
||||
conf.env.MSENVIRON = _join(conf.env.DATADIR,conf.env.MSPATH)
|
||||
conf.env.MSCONF = _join(conf.env.SYSCONFDIR,conf.env.MSPATH)
|
||||
conf.env.MSLOGDIR = _join(conf.env.LOCALSTATEDIR,"log",conf.env.MSPATH)
|
||||
conf.env.MSMNTDIR = _join(conf.env.SHAREDSTATEDIR,conf.env.PACKAGE,"mnt")
|
||||
conf.check_tool('compiler_cc')
|
||||
conf.check_cc(lib='dl')
|
||||
conf.check_tool('usermgmt')
|
||||
conf.check_message_1('Determining management server user name')
|
||||
msuser = getattr(Options.options, 'MSUSER', '')
|
||||
if msuser:
|
||||
conf.env.MSUSER = msuser
|
||||
conf.check_message_2("%s (forced through --tomcat-user)"%conf.env.MSUSER,"GREEN")
|
||||
else:
|
||||
conf.env.MSUSER = conf.env.PACKAGE
|
||||
conf.check_message_2("%s (Linux default)"%conf.env.MSUSER,"GREEN")
|
||||
conf.check_tool("javadir")
|
||||
conf.env.PREMIUMJAVADIR = _join(conf.env.JAVADIR,"%s-premium"%conf.env.PACKAGE)
|
||||
conf.env.PLUGINJAVADIR = _join(conf.env.JAVADIR,"%s-plugins"%conf.env.PACKAGE)
|
||||
conf.env.SYSTEMJAVADIR = "/usr/share/java"
|
||||
|
||||
in_javadir = lambda name: _join(conf.env.JAVADIR,_basename(name)) # $PREFIX/share/java
|
||||
in_system_javadir = lambda name: _join(conf.env.SYSTEMJAVADIR,name) # /usr/share/java
|
||||
in_premiumjavadir = lambda name: _join(conf.env.PREMIUMJAVADIR,name) # $PREFIX/share/java/cloud-premium
|
||||
|
||||
conf.env.COMMONLIBDIR = Utils.subst_vars(_join("${LIBDIR}","${COMMONPATH}"),conf.env)
|
||||
|
||||
conf.env.AGENTLIBDIR = Utils.subst_vars(_join("${LIBDIR}","${AGENTPATH}"),conf.env)
|
||||
conf.env.AGENTSYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${AGENTPATH}"),conf.env)
|
||||
conf.env.AGENTLOGDIR = Utils.subst_vars(_join("${LOCALSTATEDIR}","log","${AGENTPATH}"),conf.env)
|
||||
|
||||
conf.env.USAGELOGDIR = Utils.subst_vars(_join("${LOCALSTATEDIR}","log","${USAGEPATH}"),conf.env)
|
||||
conf.env.USAGESYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${USAGEPATH}"),conf.env)
|
||||
|
||||
conf.env.CPLIBDIR = Utils.subst_vars(_join("${LIBDIR}","${CPPATH}"),conf.env)
|
||||
conf.env.CPSYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${CPPATH}"),conf.env)
|
||||
conf.env.CPLOGDIR = Utils.subst_vars(_join("${LOCALSTATEDIR}","log","${CPPATH}"),conf.env)
|
||||
|
||||
conf.env.MSLOG = _join(conf.env.MSLOGDIR,"management-server.log")
|
||||
conf.env.AWSAPILOG = _join(conf.env.MSLOGDIR,"awsapi.log")
|
||||
conf.env.APISERVERLOG = _join(conf.env.MSLOGDIR,"api-server.log")
|
||||
conf.env.AGENTLOG = _join(conf.env.AGENTLOGDIR,"agent.log")
|
||||
conf.env.USAGELOG = _join(conf.env.USAGELOGDIR,"usage.log")
|
||||
conf.env.CPLOG = _join(conf.env.CPLOGDIR,"console-proxy.log")
|
||||
|
||||
conf.env.SETUPDATADIR = Utils.subst_vars(_join("${DATADIR}","${SETUPPATH}"),conf.env)
|
||||
|
||||
conf.env.SERVERSYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${SERVERPATH}"),conf.env)
|
||||
conf.env.PIDDIR = _join(conf.env.LOCALSTATEDIR,"run")
|
||||
conf.env.LOCKDIR = _join(conf.env.LOCALSTATEDIR,"lock","subsys")
|
||||
|
||||
|
||||
conf.check_message_1('Building classpaths')
|
||||
|
||||
# == Here we build the run-time classpaths ==
|
||||
|
||||
# The system classpath points to JARs we expect the user has installed using distro packages
|
||||
# not used for Windows and Mac (except for servlet-api.jar) because we install them from the thirdparty/ directory
|
||||
sysjars = list(systemjars['common'])
|
||||
if conf.env.DISTRO in systemjars.keys(): sysjars = sysjars + list(systemjars[conf.env.DISTRO])
|
||||
conf.env.SYSTEMJARS = " ".join(sysjars) # used by build-classpath in the initscripts
|
||||
conf.env.SYSTEMCLASSPATH = pathsep.join([ in_system_javadir(x) for x in sysjars ]) # used for compile, waf run and simulate_agent
|
||||
|
||||
# the deps classpath points to JARs that are installed in the cloud-deps package
|
||||
# these will install on Tomcat6's lib/ directory on Windows and Mac
|
||||
depsclasspath = [ in_javadir(_basename(x)) for x in _glob(_join(conf.srcdir,"deps","*.jar")) ]
|
||||
conf.env.DEPSCLASSPATH = pathsep.join(depsclasspath)
|
||||
|
||||
# the MS classpath points to JARs required to run the management server
|
||||
msclasspath = [ in_javadir("%s-%s.jar"%(conf.env.PACKAGE,x)) for x in "utils api core server server-extras core-extras vmware-base ovm dp-user-concentrated-pod dp-user-dispersing host-allocator-random plugin-f5 plugin-netscaler plugin-ovs plugin-srx storage-allocator-random user-authenticator-ldap user-authenticator-md5 user-authenticator-plaintext vmware plugin-hypervisor-xen plugin-nicira-nvp plugin-elb plugin-netapp plugin-bigswitch-vns".split() ]
|
||||
conf.env.MSCLASSPATH = pathsep.join(msclasspath)
|
||||
|
||||
# the agent and simulator classpaths point to JARs required to run these two applications
|
||||
agentclasspath = [ in_javadir("%s-%s.jar"%(conf.env.PACKAGE,x)) for x in "utils api core server server-extras agent console-common console-proxy core-extras agent-extras plugin-hypervisor-kvm".split() ]
|
||||
agentclasspath.append(in_javadir("jna.jar"))
|
||||
conf.env.AGENTCLASSPATH = pathsep.join(agentclasspath)
|
||||
conf.env.AGENTSIMULATORCLASSPATH = pathsep.join(agentclasspath+[in_javadir("%s-agent-simulator.jar"%conf.env.PACKAGE)])
|
||||
|
||||
usageclasspath = [ in_javadir("%s-%s.jar"%(conf.env.PACKAGE,x)) for x in "utils api core server server-extras usage core-extras".split() ]
|
||||
conf.env.USAGECLASSPATH = pathsep.join(usageclasspath)
|
||||
|
||||
# the premium classpath was ELIMINATED
|
||||
# CloudStack now detects the premium classpath at runtime by iterating through the JAR files in @PREMIUMJAVADIR@
|
||||
# premium JARs will install on Tomcat6's lib/ directory on Windows and Mac
|
||||
|
||||
# The compile path is composed of the
|
||||
# 1. source directories (without including the JARs)
|
||||
# JARs are not included because in case of parallel compilation (IOW, all the time), javac picks up half-written JARs and die
|
||||
compilecp = []# list(srcdirs)
|
||||
# 2.b) the deps/ directory in the source if on Linux
|
||||
# 2.a) the thirdparty/ directory if available
|
||||
if conf.env.DISTRO in ["Windows","Mac"]:
|
||||
pass
|
||||
else:
|
||||
compilecp+= _glob(_join("deps","*.jar"))
|
||||
compilecp+= _glob(_join("cloudstack-proprietary","thirdparty","*.jar"))
|
||||
# 3. the system classpath (system-installed JARs)
|
||||
compilecp+= [ conf.env.SYSTEMCLASSPATH ]
|
||||
compilecp+= _glob(_join(conf.env.TOMCATHOME,'bin',"*.jar"))
|
||||
compilecp+= _glob(_join(conf.env.TOMCATHOME,'lib',"*.jar"))
|
||||
conf.env.CLASSPATH = pathsep.join(compilecp)
|
||||
conf.check_message_2('Done','GREEN')
|
||||
|
||||
# log4j config and property config files require backslash escapes on Windows
|
||||
|
||||
conf.env.COMMONLIBDIR = Utils.subst_vars(_join("${LIBDIR}","${COMMONPATH}"),conf.env)
|
||||
|
||||
conf.env.AGENTLIBDIR = Utils.subst_vars(_join("${LIBDIR}","${AGENTPATH}"),conf.env)
|
||||
conf.env.AGENTSYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${AGENTPATH}"),conf.env)
|
||||
conf.env.AGENTLOGDIR = Utils.subst_vars(_join("${LOCALSTATEDIR}","log","${AGENTPATH}"),conf.env)
|
||||
|
||||
conf.env.USAGELOGDIR = Utils.subst_vars(_join("${LOCALSTATEDIR}","log","${USAGEPATH}"),conf.env)
|
||||
conf.env.USAGESYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${USAGEPATH}"),conf.env)
|
||||
|
||||
conf.env.CPLIBDIR = Utils.subst_vars(_join("${LIBDIR}","${CPPATH}"),conf.env)
|
||||
conf.env.CPSYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${CPPATH}"),conf.env)
|
||||
conf.env.CPLOGDIR = Utils.subst_vars(_join("${LOCALSTATEDIR}","log","${CPPATH}"),conf.env)
|
||||
|
||||
conf.env.CLIPATH = _join(conf.env.PACKAGE,"cli")
|
||||
|
||||
conf.env.IPALLOCATORLIBDIR = Utils.subst_vars(_join("${LIBDIR}","${IPALLOCATORPATH}"),conf.env)
|
||||
conf.env.IPALLOCATORSYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${IPALLOCATORPATH}"),conf.env)
|
||||
conf.env.IPALLOCATORLOGDIR = Utils.subst_vars(_join("${LOCALSTATEDIR}","log","${IPALLOCATORPATH}"),conf.env)
|
||||
|
||||
conf.env.MSLOG = _join(conf.env.MSLOGDIR,"management-server.log")
|
||||
conf.env.APISERVERLOG = _join(conf.env.MSLOGDIR,"api-server.log")
|
||||
conf.env.AGENTLOG = _join(conf.env.AGENTLOGDIR,"agent.log")
|
||||
conf.env.USAGELOG = _join(conf.env.USAGELOGDIR,"usage.log")
|
||||
conf.env.CPLOG = _join(conf.env.CPLOGDIR,"console-proxy.log")
|
||||
conf.env.IPALOCATORLOG = _join(conf.env.IPALLOCATORLOGDIR,"ipallocator.log")
|
||||
|
||||
conf.env.SETUPDATADIR = Utils.subst_vars(_join("${DATADIR}","${SETUPPATH}"),conf.env)
|
||||
|
||||
conf.env.CLIDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${CLIPATH}"),conf.env)
|
||||
|
||||
conf.env.SERVERSYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${SERVERPATH}"),conf.env)
|
||||
|
||||
if conf.env.DISTRO in ["Windows"]:
|
||||
for log in "MSLOG APISERVERLOG AGENTLIBDIR USAGELOG AGENTLOG".split(): conf.env[log] = conf.env[log].replace("\\","\\\\")
|
||||
|
||||
no_java_class = lambda x: conf.check_java_class(x,with_classpath=conf.env.CLASSPATH) != 0
|
||||
def require_dependency(javacls,packagenames):
|
||||
if no_java_class(javacls):
|
||||
conf.fatal("Cannot find the Java class %s (available in the distro packages: %s)"%(
|
||||
javacls, ", ".join(packagenames)))
|
||||
def check_dependencies(deps):
|
||||
for d in deps:
|
||||
cls,pkgs = d[0],d[1:]
|
||||
require_dependency(cls,pkgs)
|
||||
|
||||
if not getattr(Options.options, 'NODEPCHECK', ''): check_dependencies(hard_deps)
|
||||
|
||||
Utils.pprint("WHITE","Configure finished. Use 'python waf showconfig' to show the configure-time environment.")
|
||||
Loading…
x
Reference in New Issue
Block a user