From e881910df20917784b6fb2c7a952b98827c0e135 Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Sun, 12 Nov 2006 21:24:13 +0000 Subject: [PATCH] Add batch_sign.sh --- .../org.eclipse.rse.build/bin/batch_sign.sh | 85 +++++++++++++++++++ .../bin/doit_irsbuild.sh | 9 ++ 2 files changed, 94 insertions(+) create mode 100755 releng/org.eclipse.rse.build/bin/batch_sign.sh diff --git a/releng/org.eclipse.rse.build/bin/batch_sign.sh b/releng/org.eclipse.rse.build/bin/batch_sign.sh new file mode 100755 index 00000000000..7d8295d4131 --- /dev/null +++ b/releng/org.eclipse.rse.build/bin/batch_sign.sh @@ -0,0 +1,85 @@ +#!/bin/sh +#******************************************************************************* +# Copyright (c) 2006 Wind River Systems, Inc. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Martin Oberhuber - initial API and implementation +#******************************************************************************* +#:# +#:# Script to sign all ZIP files in a directory +#:# +#:# Usage: +#:# batch_sign.sh {directory} +#:# Examples: +#:# batch_sign.sh publish/S-1.0M5-200611100500 + +#nothing we do should be hidden from the world +##newgrp dsdp-tm-rse # newgrp doesnt work from shellscripts -- use sg instead +umask 2 + +#Use Java5 on build.eclipse.org +#export PATH=/shared/common/ibm-java2-ppc64-50/bin:$PATH +export PATH=/shared/webtools/apps/IBMJava2-ppc64-142/bin:$PATH +#export PATH=/shared/webtools/apps/IBMJava2-ppc-142/bin:$PATH + +curdir=`pwd` + +#Get parameters +dirToSign=$1 +usage=0 +if [ "$dirToSign" = "" ]; then + usage=1 +elif [ ! -d "$dirToSign" ]; then + usage=1 +fi +if [ $usage = 1 ]; then + grep '^#:#' $0 | grep -v grep | sed -e 's,^#:#,,' + exit 0 +fi + +#sign the zipfiles +cd "$dirToSign" +RDIR=`pwd` +sg dsdp-tm-rse -c "mkdir -p signed" +nameToSign=`basename $RDIR` +ZIPS=`ls *.zip *.jar` +STAGING=/home/data/httpd/download-staging.priv/dsdp/tm +STDIR=${STAGING}/${nameToSign} +mkdir -p ${STDIR} +cp ${ZIPS} ${STDIR} +cd ${STDIR} +mkdir out +for x in $ZIPS ; do + sign $x nomail ${STDIR}/out +done +echo "Waiting for signature..." +sleep 300 +TRIES=20 +do + MISSING="" + sleep 60 + for x in $ZIPS ; do + if [ -f ${STDIR}/out/$x ]; then + echo "Done: TRIES=${TRIES}, $x" + sg dsdp-tm-rse -c "cp -f ${STDIR}/out/$x ${RDIR}/signed/$x" + else + MISSING="${MISSING} $x" + fi + done + echo "Signed: TRIES=${TRIES}, Missing ${MISSING}" + ZIPS="${MISSING}" + TRIES=`expr $TRIES - 1` +while [ "$MISSING" != "" -a ${TRIES} -gt 0 ] +rm -rf ${STDIR} + +cd "$curdir" +if [ "$MISSING" != "" ]; then + echo "batch_sign failed: ${MISSING}" + exit 1 +fi +echo "batch_sign complete" +exit 0 diff --git a/releng/org.eclipse.rse.build/bin/doit_irsbuild.sh b/releng/org.eclipse.rse.build/bin/doit_irsbuild.sh index 3156b47208b..65a4ac86561 100755 --- a/releng/org.eclipse.rse.build/bin/doit_irsbuild.sh +++ b/releng/org.eclipse.rse.build/bin/doit_irsbuild.sh @@ -43,6 +43,10 @@ if [ $ok != 1 ]; then exit 0 fi +#get mydir +cd `dirname $0` +mydir=`pwd` + #Remove old logs and builds echo "Removing old logs and builds..." cd $HOME/ws @@ -81,6 +85,11 @@ if [ -f package.count -a "$FILES" != "" ]; then #hide the release for now until it is tested #mirrors will still pick it up mv package.count package.count.orig + #DO_SIGN=1 + fi + if [ "$DO_SIGN" = "1" ]; then + #sign the zipfiles + ${mydir}/batch_sign.sh `pwd` fi #update the doc server