commit 51acc5adff94ab93e5c55a84e9136ad06a4505cb
Author:     Mauro Talevi <mauro.tal...@aquilonia.org>
AuthorDate: Thu Jun 28 16:33:29 2012 +0200
Commit:     Mauro Talevi <mauro.tal...@aquilonia.org>
CommitDate: Thu Jun 28 16:33:29 2012 +0200

    Added scripts for uploading all download pages.

diff --git a/site-upload/upload-download.sh b/site-upload/upload-download.sh
new file mode 100755
index 0000000..80b0ef6
--- /dev/null
+++ b/site-upload/upload-download.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+ARTIFACT=$1
+VERSION=$2
+QUALIFIER=$3
+
+if [ "$ARTIFACT" == "" ] || [ "$VERSION" == "" ] || [ "$QUALIFIER" == "" ]; 
then
+  echo "usage: upload-download.sh <artifact> <version> <qualifier>"
+  exit;
+fi
+
+DOWNLOADS="/var/www/jbehave.org/reference/downloads"
+GROUP_ID="org.jbehave"
+GROUP_PATH="org/jbehave"
+ARTIFACT_ID="jbehave-distribution"
+PATH=""
+# TODO replace with regex extraction
+if [ "$ARTIFACT" == "jbehave-site" ] ; then
+  GROUP_ID="org.jbehave.site"
+  GROUP_PATH="org/jbehave/site"
+  ARTIFACT_ID="jbehave-site-frontend"
+  PATH="site"
+elif [ "$ARTIFACT" == "jbehave-web" ] ; then
+  GROUP_ID="org.jbehave.web"
+  GROUP_PATH="org/jbehave/web"
+  ARTIFACT_ID="jbehave-web-distribution"
+  PATH="web"
+fi
+
+if [ "$PATH" != "" ] ; then
+  DOWNLOADS="$DOWNLOADS/$PATH"
+fi
+
+NEXUS="https://nexus.codehaus.org/content/repositories/releases";
+
+for TYPE in "bin" "src"
+do
+INDEX="index-$TYPE-$VERSION.html"
+VERSIONED="$DOWNLOADS/$TYPE/$VERSION"
+URL="$NEXUS/$GROUP_PATH/$ARTIFACT_ID/$VERSION/$ARTIFACT_ID-$VERSION-$TYPE.zip"
+DOWNLOAD="<html><head><meta http-equiv=\"REFRESH\" 
content=\"0;url=$URL\"></head></html>"
+echo $DOWNLOAD > target/$INDEX
+/usr/bin/scp target/$INDEX jbehave.org:uploads
+/usr/bin/ssh jbehave.org "mkdir -p $VERSIONED; mv uploads/$INDEX 
$VERSIONED/index.html; cd $DOWNLOADS/$TYPE; rm $QUALIFIER; ln -s $VERSION 
$QUALIFIER"
+done 
+
diff --git a/site-upload/upload.sh b/site-upload/upload.sh
index e37bd9b..01e4d6e 100755
--- a/site-upload/upload.sh
+++ b/site-upload/upload.sh
@@ -1,9 +1,12 @@
 
 ./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
 
+./upload-reference.sh jbehave 3.6.7 stable
+./upload-reference.sh jbehave-web 3.5.3 stable
+
+./upload-download.sh jbehave 3.6.7 stable
+./upload-download.sh jbehave-web 3.5.3 stable
 
 



Reply via email to