You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2013/09/25 03:28:19 UTC

svn commit: r1526083 - in /lucene/dev/trunk/dev-tools/scripts: prep-solr-ref-guide-rc.sh publish-solr-ref-guide.sh

Author: hossman
Date: Wed Sep 25 01:28:19 2013
New Revision: 1526083

URL: http://svn.apache.org/r1526083
Log:
SOLR-5257: new scripts for use with solr ref guide RCs and publishing

Added:
    lucene/dev/trunk/dev-tools/scripts/prep-solr-ref-guide-rc.sh   (with props)
    lucene/dev/trunk/dev-tools/scripts/publish-solr-ref-guide.sh   (with props)

Added: lucene/dev/trunk/dev-tools/scripts/prep-solr-ref-guide-rc.sh
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/dev-tools/scripts/prep-solr-ref-guide-rc.sh?rev=1526083&view=auto
==============================================================================
--- lucene/dev/trunk/dev-tools/scripts/prep-solr-ref-guide-rc.sh (added)
+++ lucene/dev/trunk/dev-tools/scripts/prep-solr-ref-guide-rc.sh Wed Sep 25 01:28:19 2013
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# 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.
+
+###
+
+# Prepares an RC of the Solr Ref Guide by doing local file operations to:
+#  - create a directory for the RC files
+#  - move the PDF files into the RC directory with the appropriate name
+#  - generate a SHA1 of the PDF file
+#  - GPG sign the PDF files
+#
+# See: https://cwiki.apache.org/confluence/display/solr/Internal+-+How+To+Publish+This+Documentation
+
+if [ $# -lt 2 ] || [ 3 -lt $# ] ; then
+    echo "Usage: $0 <exported-file.pdf> <X.Y-RCZ> [gpg-pubkey-id]"
+    echo ""
+    echo "Examples: "
+    echo "    $0 solr-123456-7890-6543.pdf 4.5-RC0"
+    echo "or  $0 solr-123456-7890-6543.pdf 4.5-RC0 DEADBEEF"
+    echo ""
+    echo "If no GPG key ID is specified, GPG will use your default key"
+    exit 1;
+fi
+
+PREFIX="apache-solr-ref-guide"
+SRC_FILE=$1
+DIR="$PREFIX-$2"
+PDF="$DIR/$PREFIX-$2.pdf"
+SHA="$PDF.sha1"
+GPG="$PDF.asc"
+
+if [ ! -e $SRC_FILE ] ; then
+   echo "! ! ! Can't proceed, file does not exist: $SRC_FILE"
+   exit 1;
+fi
+
+if [ -d $DIR ] ; then
+   echo "! ! ! Can't proceed, directory already exists: $DIR"
+   exit 1;
+fi
+
+GPG_ID_ARG=""
+if [ ! -z "$3" ] ; then
+  GPG_ID_ARG="-u $3"
+fi
+
+# from here on, use set -x to echo progress and rely on decent error messages
+# from shell commands that might fail.
+ 
+set -x
+
+mkdir $DIR || exit 1
+mv $SRC_FILE $PDF || exit 1
+sha1sum $PDF > $SHA || exit 1
+gpg $GPG_ID_ARG --armor --output $GPG --detach-sig $PDF|| exit 1
+

Added: lucene/dev/trunk/dev-tools/scripts/publish-solr-ref-guide.sh
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/dev-tools/scripts/publish-solr-ref-guide.sh?rev=1526083&view=auto
==============================================================================
--- lucene/dev/trunk/dev-tools/scripts/publish-solr-ref-guide.sh (added)
+++ lucene/dev/trunk/dev-tools/scripts/publish-solr-ref-guide.sh Wed Sep 25 01:28:19 2013
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# 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.
+
+####
+
+# Convinience script to generates the SVN command line for you to run in order to 
+# publish an RC of the Solr Ref Guide that is already in the dist/dev repo (so that
+# all of the files for that RC will be moved into the dist/release hierarchy).
+#
+# See: https://cwiki.apache.org/confluence/display/solr/Internal+-+How+To+Publish+This+Documentation
+
+if [ $# -ne 1 ] ; then
+    echo "Usage: $0 <X.Y-RCZ>"
+    echo ""
+    echo "Example: "
+    echo "    $0 4.5-RC0"
+    echo ""
+    echo "An RC with that version & RC# must already exist"
+    exit 1
+fi
+
+PREFIX="apache-solr-ref-guide"
+RC="$PREFIX-$1"
+RC_URL="https://dist.apache.org/repos/dist/dev/lucene/solr/ref-guide/$RC"
+MV_CMD="svn move -m 'publishing $RC'"
+RM_CMD="svn rm -m 'cleaning up $RC' $RC_URL"
+COUNT=0
+
+for FILE in `svn list $RC_URL`; do
+  COUNT=`expr $COUNT + 1`
+  MV_CMD="$MV_CMD $RC_URL/$FILE"
+done
+
+if [ $COUNT -eq 0 ] ; then
+   echo "Unable to find any files in RC Directory: $RC_URL"
+   exit 0;
+fi
+
+#destination of move...
+MV_CMD="$MV_CMD https://dist.apache.org/repos/dist/release/lucene/solr/ref-guide/"
+
+echo "## Run the following commands when ready..."
+echo $MV_CMD
+echo $RM_CMD