Quellcode durchsuchen

Created a release script.

Use a local directory for deploying the site, since it seems impossible to get an accurate copy of the site otherwise using maven 2.

Revert to cobertura 2.0 plugin as 2.1 is broken (gives 100% coverage for everything).
Luke Taylor vor 18 Jahren
Ursprung
Commit
7207dd6f19
2 geänderte Dateien mit 84 neuen und 7 gelöschten Zeilen
  1. 10 7
      pom.xml
  2. 74 0
      releasebuild.sh

+ 10 - 7
pom.xml

@@ -61,12 +61,13 @@
 			</url>
 		</snapshotRepository>
 		<site>
-			<id>sourceforge.net</id>
-			<name>Acegi Website at Sourceforge</name>
-            <!--<url>file:///Users/luke/acegisite/</url>-->
-            <url>
-				scp://shell.sourceforge.net/home/groups/a/ac/acegisecurity/htdocs/maven2
-			</url>
+			<id>local</id>
+			<name>Local Site Directory</name>
+            <!--
+            This variable is set by the build release script. You can also set it on the command line if
+            you are running maven directly. e.g. mvn site -DsiteDirectory=file:///home/joe/mysite
+            -->
+            <url>${siteDirectory}</url>
         </site>
 	</distributionManagement>
 
@@ -431,7 +432,9 @@
 			<plugin>
 				<groupId>org.codehaus.mojo</groupId>
 				<artifactId>cobertura-maven-plugin</artifactId>
-			</plugin>
+                <!-- Version 2.1 reports 100% coverage for everything. Nice but not very practical -->
+                <version>2.0</version>
+            </plugin>
 
             <plugin>
 				<groupId>org.apache.maven.plugins</groupId>

+ 74 - 0
releasebuild.sh

@@ -0,0 +1,74 @@
+#! /bin/sh
+
+# This script must be run from the project root directory
+
+# Edit this release number before running. It is used to check jar names etc.
+RELEASE_VERSION=1.0.5-SNAPSHOT
+
+PROJ_DIR=`pwd`;
+RELEASE_DIR=$PROJ_DIR/release
+SITE_DIR=$RELEASE_DIR/site
+
+echo "** Project directory is $PROJ_DIR"
+
+SVN_REV=`svn info $PROJ_DIR | grep Revision | sed "s/Revision: //"`
+
+echo "** Building from revision $SVN_REV"
+
+
+if [[ -e $RELEASE_DIR ]]
+then
+   rm -Rf $RELEASE_DIR
+fi
+
+mkdir $RELEASE_DIR
+mkdir $SITE_DIR
+
+# run maven to generate jars
+
+mvn clean install -DcreateChecksum=true
+
+if [ "$?" -ne 0 ]
+then
+  echo "mvn install failed"
+  exit 1;
+fi
+
+echo "** Generating site in $SITE_DIR".
+
+mvn site docbkx:generate-html docbkx:generate-pdf site:deploy -DsiteDirectory=file://${SITE_DIR}
+
+if [ "$?" -ne 0 ]
+then
+  echo "mvn site generation failed"
+  exit 1;
+fi
+
+
+# Assemble the required jar files
+
+find . -name "*${RELEASE_VERSION}.jar" | grep -v WEB-INF | xargs -J % -n 1  cp % $RELEASE_DIR
+find . -name "*${RELEASE_VERSION}.war" | xargs -J % -n 1  cp % $RELEASE_DIR
+
+# Should be 9 archives - core, core-tiger, the adapters (cas, jboss, resin, jetty, catalina), tutorial and contacts wars.
+
+pushd $RELEASE_DIR
+
+NUM_JARS=`ls *.jar *.war | wc -l`
+
+if [ "$NUM_JARS" -ne 9 ]
+then
+  echo "Expected 9 Jar files but found $NUM_JARS."
+  exit 1
+fi
+
+# Create the signatures
+
+for jar in $(ls *.jar *.war); do
+  openssl sha1 < $jar > $jar.sha1
+  openssl md5 < $jar > $jar.md5
+done
+
+popd
+
+