commit ff71bffcfb876102189d4d6c54b268cdeb18cb02
Author:     Mauro Talevi <mauro.tal...@aquilonia.org>
AuthorDate: Thu Jun 28 16:21:14 2012 +0200
Commit:     Mauro Talevi <mauro.tal...@aquilonia.org>
CommitDate: Thu Jun 28 16:21:14 2012 +0200

    Added scripts for uploading all site references.

diff --git a/site-upload/upload-reference.sh b/site-upload/upload-reference.sh
new file mode 100755
index 0000000..b63d33d
--- /dev/null
+++ b/site-upload/upload-reference.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+ARTIFACT=$1
+VERSION=$2
+QUALIFIER=$3
+
+if [ "$ARTIFACT" == "" ] || [ "$VERSION" == "" ] || [ "$QUALIFIER" == "" ]; 
then
+  echo "usage: upload-reference.sh <artifact> <version> <qualifier>"
+  exit;
+fi
+
+REFERENCE="/var/www/jbehave.org/reference"
+GROUP_ID="org.jbehave"
+ARTIFACT_ID="jbehave-distribution"
+PATH=""
+# TODO replace with regex extraction
+if [ "$ARTIFACT" == "jbehave-site" ] ; then
+  GROUP_ID="org.jbehave.site"
+  ARTIFACT_ID="jbehave-site-frontend"
+  PATH="site"
+elif [ "$ARTIFACT" == "jbehave-web" ] ; then
+  GROUP_ID="org.jbehave.web"
+  ARTIFACT_ID="jbehave-web-distribution"
+  PATH="web"
+fi
+
+ARTIFACT_FULL="$GROUP_ID:$ARTIFACT_ID:$VERSION:zip:bin"
+VERSIONED_ARTIFACT="uploads/$ARTIFACT-$VERSION"
+ZIPPED_ARTIFACT="$ARTIFACT.zip"
+if [ "$PATH" != "" ] ; then
+  REFERENCE="$REFERENCE/$PATH"
+fi
+VERSIONED_REFERENCE="$REFERENCE/$VERSION"
+
+$MVN_HOME/bin/mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:get 
-Dartifact=$ARTIFACT_FULL -Dtransitive=false -Ddest=target/$ZIPPED_ARTIFACT
+
+/usr/bin/scp target/$ZIPPED_ARTIFACT jbehave.org:uploads/
+/usr/bin/ssh jbehave.org "rm -rf $VERSIONED_ARTIFACT; unzip -q -d uploads 
uploads/$ZIPPED_ARTIFACT; rm -r $VERSIONED_REFERENCE; mv 
$VERSIONED_ARTIFACT/docs/ $VERSIONED_REFERENCE; cd $REFERENCE; rm $QUALIFIER; 
ln -s $VERSION $QUALIFIER"
diff --git a/site-upload/upload.sh b/site-upload/upload.sh
new file mode 100755
index 0000000..e37bd9b
--- /dev/null
+++ b/site-upload/upload.sh
@@ -0,0 +1,9 @@
+
+./upload-reference.sh jbehave-site 3.2-SNAPSHOT latest
+./upload-reference.sh jbehave 3.6.7 stable
+./upload-reference.sh jbehave 3.7-SNAPSHOT latest
+./upload-reference.sh jbehave-web 3.5.3 stable
+./upload-reference.sh jbehave-web 3.6-SNAPSHOT latest
+
+
+



Reply via email to