]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
NOJIRA create_db made recursive. create_db now exists for id, account and
authorSanjay Dalal <sanjay.dalal@berkeley.edu>
Tue, 24 Nov 2009 22:38:32 +0000 (22:38 +0000)
committerSanjay Dalal <sanjay.dalal@berkeley.edu>
Tue, 24 Nov 2009 22:38:32 +0000 (22:38 +0000)
authentication services in addition to trunk. Update local build.properties to
incorporate new JDBC related properties from this checkin. Deploy now also copies
db scripts to destination domain.
tests: ant create_db at trunk
mvn test at service

M    trunk/services/authentication/service/build.xml
M    trunk/services/authentication/build.xml
M    trunk/services/id/service/build.xml
M    trunk/services/id/build.xml
M    trunk/services/account/build.xml
A    trunk/services/account/client/build.xml
M    trunk/services/build.xml
M    trunk/nbproject/private/private.xml
A  + trunk/src/main/resources/db
D    trunk/src/main/resources/scripts/db
M    trunk/build.properties
M    trunk/build.xml

12 files changed:
build.properties
build.xml
nbproject/private/private.xml
services/account/build.xml
services/account/client/build.xml [new file with mode: 0644]
services/authentication/build.xml
services/authentication/service/build.xml
services/build.xml
services/id/build.xml
services/id/service/build.xml
src/main/resources/db/mysql/init_db.sql [moved from src/main/resources/scripts/db/mysql/init_db.sql with 100% similarity]
src/main/resources/db/mysql/service-dump.sql [moved from src/main/resources/scripts/db/mysql/service-dump.sql with 100% similarity]

index 4479f23b1e0d0b6d17c95691d8d814b938c5d2a0..956127b9ea11b6a6b96110003026a4f6d13375fc 100644 (file)
@@ -36,7 +36,7 @@ dist.deploy.nuxeo.system=${dist.deploy.nuxeo}/${nuxeo.system}
 #jboss\r
 #assumption: both nuxeo and cspace domains are using the same JBoss installation\r
 jboss.release=jboss-4.2.3.GA\r
-jboss.dir=C:/dev/${jboss.release}\r
+jboss.dir=/home/sanjaydalal/work/${jboss.release}\r
 jboss.home=${jboss.dir}\r
 \r
 #jboss cspace domain\r
@@ -55,3 +55,11 @@ jboss.deploy.nuxeo=${jboss.server.nuxeo}/deploy
 jboss.lib.nuxeo=${jboss.server.nuxeo}/lib\r
 jboss.deploy.nuxeo.system=${jboss.deploy.nuxeo}/${nuxeo.system}\r
 \r
+#database\r
+db=mysql\r
+db.script.dir=${basedir}/src/main/resources/db/${db}\r
+db.user=root\r
+db.user.password=admin\r
+db.host=localhost\r
+db.port=3306\r
+db.driver.jar=${jboss.lib.cspace}/mysql-connector-java-5.1.7-bin.jar
\ No newline at end of file
index 4cbc54949ed872c2574b20d4dec342f9ee9c6db0..7af82a079190535e6ad7642630b55617eabde5c1 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -8,10 +8,6 @@
     <property name="mvn.opts" value="" />\r
     <property name="src" location="src"/>\r
 \r
-    <property name="db" value="mysql"/>\r
-    <property name="db.script.dir" location="${basedir}/src/main/resources/scripts/db/${db}"/>\r
-\r
-\r
     <condition property="osfamily-unix">\r
         <os family="unix" />\r
     </condition>\r
     <target name="create_db"\r
     description="create database(s), grant privileges to test users">\r
         <sql driver="com.mysql.jdbc.Driver"\r
-        url="jdbc:mysql://localhost:3306/cspace"\r
-        userid="root"\r
-        password=""\r
+        url="jdbc:mysql://${db.host}:${db.port}/cspace"\r
+        userid="${db.user}"\r
+        password="${db.user.password}"\r
         src="${db.script.dir}/init_db.sql"\r
         >\r
             <classpath>\r
-                <pathelement path="${jboss.lib.cspace}/mysql-connector-java-5.1.7-bin.jar"/>\r
+                <pathelement path="${db.driver.jar}"/>\r
             </classpath>\r
         </sql>\r
+        <ant antfile="services/build.xml" target="create_db" inheritAll="false"/>\r
     </target>\r
 \r
     <target name="deploy" depends="install"\r
     description="deploy services in ${jboss.server.cspace}">\r
                 <!-- copy db scripts, etc. -->\r
         <copy todir="${jboss.server.cspace}/cspace/services">\r
-            <fileset dir="${src}/main/resources/scripts"/>\r
+            <fileset dir="${src}/main/resources/"/>\r
         </copy>\r
         <!-- copy datasources -->\r
         <copy todir="${jboss.deploy.cspace}">\r
index 392f2c6e0e7e402755846b50cf1a0ef08121fb8a..c1f155a782bd6f432a8846f3d3b308ba6fa6856c 100644 (file)
@@ -1,8 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<project-private xmlns="http://www.netbeans.org/ns/project-private/1">\r
-    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>\r
-    <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/1">\r
-        <file>file:/C:/dev/src/cs/src/services/trunk/build.xml</file>\r
-        <file>file:/C:/dev/src/cs/src/services/trunk/pom.xml</file>\r
-    </open-files>\r
-</project-private>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
+    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
+</project-private>
index 445894e2f47afa8b4ae0193c7d8096ac186d06c8..6c5a6f903f4ff31aefc8092baef98b2169dc04a7 100644 (file)
         </exec>\r
     </target>\r
 \r
+    <target name="create_db"\r
+    description="create tables(s), indices for account service">\r
+        <ant antfile="client/build.xml" target="create_db" inheritAll="false"/>\r
+    </target>\r
+\r
     <target name="deploy" depends="install"\r
     description="deploy collectionobject service">\r
         <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>\r
 \r
     <target name="dist" depends="package"\r
     description="distribute collectionobject service}">\r
-        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>\r
+        <ant antfile="client/build.xml" target="dist" inheritall="false"/>\r
     </target>\r
 \r
 </project>\r
diff --git a/services/account/client/build.xml b/services/account/client/build.xml
new file mode 100644 (file)
index 0000000..1a316e4
--- /dev/null
@@ -0,0 +1,142 @@
+\r
+<project name="account.client" default="package" basedir=".">\r
+    <description>\r
+        collectionspace account service\r
+    </description>\r
+  <!-- set global properties for this build -->\r
+    <property name="services.trunk" value="../../.."/>\r
+    <property file="${services.trunk}/build.properties" />\r
+    <property name="mvn.opts" value="" />\r
+    <property name="src" location="src"/>\r
+\r
+    <condition property="osfamily-unix">\r
+        <os family="unix" />\r
+    </condition>\r
+    <condition property="osfamily-windows">\r
+        <os family="windows" />\r
+    </condition>\r
+\r
+    <target name="init">\r
+    <!-- Create the time stamp -->\r
+        <tstamp/>\r
+    </target>\r
+\r
+\r
+    <target name="package" depends="package-unix,package-windows"\r
+  description="Package CollectionSpace Services" />\r
+    <target name="package-unix" if="osfamily-unix">\r
+        <exec executable="mvn" failonerror="true">\r
+            <arg value="package" />\r
+            <arg value="-Dmaven.test.skip=true" />\r
+            <arg value="-f" />\r
+            <arg value="${basedir}/pom.xml" />\r
+            <arg value="-N" />\r
+            <arg value="${mvn.opts}" />\r
+        </exec>\r
+    </target>\r
+    <target name="package-windows" if="osfamily-windows">\r
+        <exec executable="cmd" failonerror="true">\r
+            <arg value="/c" />\r
+            <arg value="mvn.bat" />\r
+            <arg value="package" />\r
+            <arg value="-Dmaven.test.skip=true" />\r
+            <arg value="-f" />\r
+            <arg value="${basedir}/pom.xml" />\r
+            <arg value="-N" />\r
+            <arg value="${mvn.opts}" />\r
+        </exec>\r
+    </target>\r
+\r
+    <target name="install" depends="package,install-unix,install-windows"\r
+  description="Install" />\r
+    <target name="install-unix" if="osfamily-unix">\r
+        <exec executable="mvn" failonerror="true">\r
+            <arg value="install" />\r
+            <arg value="-Dmaven.test.skip=true" />\r
+            <arg value="-f" />\r
+            <arg value="${basedir}/pom.xml" />\r
+            <arg value="-N" />\r
+            <arg value="${mvn.opts}" />\r
+        </exec>\r
+    </target>\r
+    <target name="install-windows" if="osfamily-windows">\r
+        <exec executable="cmd" failonerror="true">\r
+            <arg value="/c" />\r
+            <arg value="mvn.bat" />\r
+            <arg value="install" />\r
+            <arg value="-Dmaven.test.skip=true" />\r
+            <arg value="-f" />\r
+            <arg value="${basedir}/pom.xml" />\r
+            <arg value="-N" />\r
+            <arg value="${mvn.opts}" />\r
+        </exec>\r
+    </target>\r
+    \r
+    <target name="clean" depends="clean-unix,clean-windows"\r
+  description="Delete target directories" >\r
+        <delete dir="${build}"/>\r
+    </target>\r
+    <target name="clean-unix" if="osfamily-unix">\r
+        <exec executable="mvn" failonerror="true">\r
+            <arg value="clean" />\r
+            <arg value="${mvn.opts}" />\r
+        </exec>\r
+    </target>\r
+    <target name="clean-windows" if="osfamily-windows">\r
+        <exec executable="cmd" failonerror="true">\r
+            <arg value="/c" />\r
+            <arg value="mvn.bat" />\r
+            <arg value="clean" />\r
+            <arg value="${mvn.opts}" />\r
+        </exec>\r
+    </target>\r
+\r
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />\r
+    <target name="test-unix" if="osfamily-unix">\r
+        <exec executable="mvn" failonerror="true">\r
+            <arg value="test" />\r
+            <arg value="${mvn.opts}" />\r
+        </exec>\r
+    </target>\r
+    <target name="test-windows" if="osfamily-windows">\r
+        <exec executable="cmd" failonerror="true">\r
+            <arg value="/c" />\r
+            <arg value="mvn.bat" />\r
+            <arg value="test" />\r
+            <arg value="${mvn.opts}" />\r
+        </exec>\r
+    </target>\r
+\r
+    <target name="create_db"\r
+    description="create tables(s), indices for account service">\r
+        <sql driver="com.mysql.jdbc.Driver"\r
+        url="jdbc:mysql://${db.host}:${db.port}/cspace"\r
+        userid="${db.user}"\r
+        password="${db.user.password}"\r
+        src="${db.script.dir}/account.sql"\r
+        >\r
+            <classpath>\r
+                <pathelement path="${db.driver.jar}"/>\r
+            </classpath>\r
+        </sql>\r
+    </target>\r
+    <target name="deploy" depends="install"\r
+    description="deploy account service in ${jboss.server.cspace}">\r
+        <copy todir="${jboss.server.cspace}/cspace/services">\r
+            <fileset dir="${src}/main/resources/"/>\r
+        </copy>\r
+    </target>\r
+\r
+    <target name="undeploy"\r
+    description="undeploy account service from ${jboss.server.cspace}">\r
+    </target>\r
+\r
+    <target name="dist"\r
+    description="generate distribution for account service" depends="package">\r
+        <!-- copy db scripts, etc. -->\r
+        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">\r
+            <fileset dir="${src}/main/resources/"/>\r
+        </copy>\r
+    </target>\r
+\r
+</project>\r
index 16f15b57345be5152b9b29cbde1b88bfdabf7617..5a88b75aea2bc3e06d207d16c2fe8cb745c47485 100644 (file)
         </exec>\r
     </target>\r
 \r
+\r
+    <target name="create_db"\r
+    description="create tables(s), indices for authentication service">\r
+        <ant antfile="service/build.xml" target="create_db" inheritAll="false"/>\r
+    </target>\r
+\r
     <target name="deploy" depends="install"\r
     description="deploy authentication service">\r
         <ant antfile="service/build.xml" target="deploy" inheritall="false"/>\r
index 5df18f8b32e05df0c867387ec908bd9b05f7f5a9..374b8c71fea5ab0a5c372382739e5828121c79c3 100644 (file)
@@ -1,5 +1,5 @@
 \r
-<project name="authentication" default="package" basedir=".">\r
+<project name="authentication.service" default="package" basedir=".">\r
     <description>\r
         collectionspace authentication service\r
     </description>\r
         </exec>\r
     </target>\r
 \r
+    <target name="create_db"\r
+    description="create tables(s), indices for authentication service">\r
+        <sql driver="com.mysql.jdbc.Driver"\r
+        url="jdbc:mysql://${db.host}:${db.port}/cspace"\r
+        userid="${db.user}"\r
+        password="${db.user.password}"\r
+        src="${db.script.dir}/authentication.sql"\r
+        >\r
+            <classpath>\r
+                <pathelement path="${db.driver.jar}"/>\r
+            </classpath>\r
+        </sql>\r
+        <sql driver="com.mysql.jdbc.Driver"\r
+        url="jdbc:mysql://${db.host}:${db.port}/cspace"\r
+        userid="${db.user}"\r
+        password="${db.user.password}"\r
+        src="${db.script.dir}/test_authn.sql"\r
+        >\r
+            <classpath>\r
+                <pathelement path="${db.driver.jar}"/>\r
+            </classpath>\r
+        </sql>\r
+    </target>\r
     <target name="deploy" depends="install"\r
     description="deploy authentication service in ${jboss.server.cspace}">\r
         <copy file="${basedir}/target/${authentication.jar}" todir="${jboss.server.cspace}/lib"/>\r
+        <copy todir="${jboss.server.cspace}/cspace/services">\r
+            <fileset dir="${src}/main/resources/"/>\r
+        </copy>\r
         <echo message="Add authentication-policy to ${jboss.server.cspace}/conf/login-config.xml"/>\r
         <echo message="Make sure cspace-ds.xml exists in ${jboss.server.cspace}/deploy"/>\r
     </target>\r
         <copy todir="${services.trunk}/${dist.lib.cspace}">\r
             <fileset file="${basedir}/target/${authentication.jar}"/>\r
         </copy>\r
+        <!-- copy db scripts, etc. -->\r
+        <copy todir="${services.trunk}/${dist.server.cspace}/cspace/services">\r
+            <fileset dir="${src}/main/resources/"/>\r
+        </copy>\r
     </target>\r
 \r
 </project>\r
index 3902c2ecb3de19b2c4cbee2fe446e71af668de10..82d6a92f099d7dc88a86435f078b5fbfb4ce4dab 100644 (file)
         </exec>\r
     </target>\r
 \r
+    <target name="create_db"\r
+    description="create service-specific tables(s), indices, etc.">\r
+        <ant antfile="authentication/build.xml" target="create_db" inheritAll="false"/>\r
+        <ant antfile="account/build.xml" target="create_db" inheritAll="false"/>\r
+        <ant antfile="id/build.xml" target="create_db" inheritAll="false"/>\r
+    </target>\r
+\r
     <!-- this target is called in order based on the dependencies between the services -->\r
     <target name="deploy" depends="install"\r
     description="deploy services in ${jboss.server.cspace}">\r
         </copy>\r
         <ant antfile="id/build.xml" target="dist_installer" inheritAll="false"/>\r
         <ant antfile="collectionobject/build.xml" target="dist_installer" inheritAll="false"/>\r
-        <ant antfile="vocabulary/build.xml" target="dist_installer" inheritAll="false"/>    \r
+        <ant antfile="vocabulary/build.xml" target="dist_installer" inheritAll="false"/>\r
 <!--\r
         <ant antfile="common/build.xml" target="dist_installer" inheritAll="false"/>\r
         <ant antfile="authentication/build.xml" target="dist_installer" inheritAll="false"/>\r
         <ant antfile="acquisition/build.xml" target="dist_installer" inheritAll="false"/>\r
         <ant antfile="JaxRsServiceProvider/build.xml" target="dist_installer" inheritAll="false"/>\r
 -->        \r
-    </target>    \r
+    </target>\r
 \r
     \r
 </project>\r
index 56d6c5c28438cbc0eb62bf5ae58f658161727709..7f6bba48a92341efea4e48c9e7dc24e4878cdb57 100644 (file)
         </exec>\r
     </target>\r
 \r
+    <target name="create_db"\r
+    description="create tables(s), indices for id service">\r
+        <ant antfile="service/build.xml" target="create_db" inheritAll="false"/>\r
+    </target>\r
+\r
     <target name="deploy" depends="install"\r
     description="deploy id service">\r
         <ant antfile="service/build.xml" target="deploy" inheritall="false"/>\r
index e20419d33e768675ab9fdceb1b81428c570604a6..c7fe75a8daf4312c951b5064ad7a9671dda70c65 100644 (file)
@@ -1,5 +1,5 @@
 
-<project name="id" default="package" basedir=".">
+<project name="id.service" default="package" basedir=".">
     <description>
         id service
     </description>
@@ -8,7 +8,6 @@
     <property file="${services.trunk}/build.properties" />
     <property name="mvn.opts" value="" />
     <property name="src" location="src"/>
-    <property name="id.jar" value="collectionspace-services-id.jar"/>
 
     <condition property="osfamily-unix">
         <os family="unix" />
         </exec>
     </target>
 
+    <target name="create_db"
+    description="create tables(s), indices for id service">
+        <sql driver="com.mysql.jdbc.Driver"
+        url="jdbc:mysql://${db.host}:${db.port}/cspace"
+        userid="${db.user}"
+        password="${db.user.password}"
+        src="${db.script.dir}/create_id_generators_table.sql"
+        >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+        </sql>
+        <sql driver="com.mysql.jdbc.Driver"
+        url="jdbc:mysql://${db.host}:${db.port}/cspace"
+        userid="${db.user}"
+        password="${db.user.password}"
+        src="${db.script.dir}/load_id_generators.sql"
+        >
+            <classpath>
+                <pathelement path="${db.driver.jar}"/>
+            </classpath>
+        </sql>
+    </target>
+
     <target name="deploy" depends="install"
     description="deploy id service">
+        <copy todir="${jboss.server.cspace}/cspace/services">
+            <fileset dir="${src}/main/resources/"/>
+        </copy>
     </target>
 
     <target name="undeploy"