mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
[releng] update make_signed.sh script
This commit is contained in:
parent
d514d2d86d
commit
d9f3dc050b
1 changed files with 96 additions and 20 deletions
|
@ -14,38 +14,60 @@
|
|||
# and current directory is a download. Will create signed downloads in subdirectory.
|
||||
#
|
||||
|
||||
UPDATE_SITE=$HOME/downloads-tm/updates/3.1milestones
|
||||
|
||||
curdir=`pwd`
|
||||
cd `dirname $0`
|
||||
mydir=`pwd`
|
||||
cd "${curdir}"
|
||||
|
||||
# Accept environment variables set outside the script
|
||||
if [ "${UPDATE_SITE}" = "" ]; then
|
||||
UPDATE_SITE=$HOME/downloads-tm/updates/3.2milestones
|
||||
fi
|
||||
if [ "${SIGNED_JAR_SOURCE}" = "" ]; then
|
||||
SIGNED_JAR_SOURCE=${curdir}/eclipse_ext/tm
|
||||
fi
|
||||
if [ "${BASEBUILDER}" = "" ]; then
|
||||
BASEBUILDER=$HOME/ws2/eclipse
|
||||
fi
|
||||
if [ "${DROPDIR}" = "" ]; then
|
||||
DROPDIR=${curdir}
|
||||
fi
|
||||
have_sdk=`ls ${DROPDIR} | grep 'RSE-SDK.*zip$'`
|
||||
if [ "${have_sdk}" = "" ]; then
|
||||
echo "No drop found in DROPDIR. Please cd to your drop, or setenv DROPDIR."
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
echo "Making a TM/RSE drop signed, based on an update site."
|
||||
echo ""
|
||||
echo "UPDATE_SITE: ${UPDATE_SITE}"
|
||||
echo "SIGNED_JAR_SOURCE: ${SIGNED_JAR_SOURCE}"
|
||||
echo "BASEBUILDER: ${BASEBUILDER}"
|
||||
echo "DROPDIR: ${DROPDIR}"
|
||||
echo ""
|
||||
|
||||
#Use Java5 on build.eclipse.org
|
||||
#export PATH=/shared/dsdp/tm/ibm-java2-ppc64-50/bin:$PATH
|
||||
export PATH=/shared/dsdp/tm/ibm-java2-ppc64-50/jre/bin:/shared/dsdp/tm/ibm-java2-ppc64-50/bin:$PATH
|
||||
#export PATH=${HOME}/ws2/IBMJava2-ppc-142/bin:$PATH
|
||||
|
||||
SIGNED_JAR_SOURCE=${mydir}/eclipse_ext/tm
|
||||
##SIGNED_JAR_SOURCE=${mydir}/eclipse_ext
|
||||
OUTPUT=${curdir}/output.$$
|
||||
RESULT=${curdir}/result.$$
|
||||
TMP=${curdir}/tmp.$$
|
||||
BASEBUILDER=$HOME/ws2/eclipse
|
||||
TMPD=${curdir}/tmp.$$
|
||||
|
||||
# Provision update site into SIGNED_JAR_SOURCE
|
||||
if [ ! -d "${SIGNED_JAR_SOURCE}" ]; then
|
||||
mkdir -p "${SIGNED_JAR_SOURCE}"
|
||||
if [ ! -d "${SIGNED_JAR_SOURCE}/eclipse" ]; then
|
||||
mkdir -p "${SIGNED_JAR_SOURCE}/eclipse"
|
||||
echo "Provisioning with repo2runnable..."
|
||||
${BASEBUILDER}/eclipse -nosplash \
|
||||
-data install-ws -consolelog -clean \
|
||||
-application org.eclipse.equinox.p2.repository.repo2runnable \
|
||||
-source file:${UPDATE_SITE} \
|
||||
-destination file:${SIGNED_JAR_SOURCE} \
|
||||
-destination file:${SIGNED_JAR_SOURCE}/eclipse \
|
||||
-vmargs \
|
||||
-Xms128M -Xmx256M -XX:PermSize=128M -XX:MaxPermSize=256M
|
||||
retval=$?
|
||||
echo "result: ${retval}"
|
||||
exit ${retval}
|
||||
fi
|
||||
|
||||
if [ ! -d ${SIGNED_JAR_SOURCE}/server ]; then
|
||||
|
@ -53,19 +75,57 @@ if [ ! -d ${SIGNED_JAR_SOURCE}/server ]; then
|
|||
fi
|
||||
have_server=`ls "${SIGNED_JAR_SOURCE}"/server/*.jar 2>/dev/null`
|
||||
if [ "${have_server}" = "" ]; then
|
||||
signed_server=""
|
||||
if [ -d "${DROPDIR}/signed" ]; then
|
||||
signed_server=`ls ${DROPDIR}/signed | grep 'rseserver-.*\.zip'`
|
||||
fi
|
||||
if [ "${signed_server}" = "" ]; then
|
||||
win_server=`ls ${DROPDIR} | grep 'rseserver-.*-windows\.zip'`
|
||||
if [ "${win_server}" = "" ]; then
|
||||
echo "Error: No rseserver found in DROPDIR."
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d /home/data/httpd/download-staging.priv/dsdp/tm ]; then
|
||||
echo "Error: Must run on build.eclipse.org to sign"
|
||||
fi
|
||||
cd /home/data/httpd/download-staging.priv/dsdp/tm
|
||||
SIGN_TMP=tmp.$$
|
||||
mkdir ${SIGN_TMP}
|
||||
cd ${SIGN_TMP}
|
||||
cp ${DROPDIR}/${win_server} .
|
||||
sign ${win_server} nomail `pwd`/out
|
||||
while [ ! -f out/${win_server} ]; do
|
||||
echo "Waiting for sign..."
|
||||
sleep 30
|
||||
done
|
||||
unzip out/${win_server} clientserver.jar
|
||||
result=`jarsigner -verify clientserver.jar | head -1`
|
||||
while [ "$result" != "jar verified." ]; do
|
||||
echo "Waiting for verification..."
|
||||
sleep 30
|
||||
unzip out/${win_server} clientserver.jar
|
||||
result=`jarsigner -verify clientserver.jar | head -1`
|
||||
done
|
||||
signed_server=`echo ${win_server} | sed -e 's,-windows,-windows-signed,'`
|
||||
echo "Signing OK, copy to ${DROPDIR}/signed/${signed_server}"
|
||||
mkdir -p ${DROPDIR}/signed
|
||||
cp out/${win_server} ${DROPDIR}/signed/${signed_server}
|
||||
cd ..
|
||||
rm -rf ${SIGN_TMP}
|
||||
fi
|
||||
cd ${SIGNED_JAR_SOURCE}/server
|
||||
unzip ${curdir}/rseserver-*-signed.zip
|
||||
unzip ${DROPDIR}/signed/${signed_server}
|
||||
have_server=`ls *.jar 2>/dev/null`
|
||||
cd "${curdir}"
|
||||
if [ "${have_server}" = "" ]; then
|
||||
echo 'ERROR: signed rseserver-*-signed.zip not found!'
|
||||
echo 'ERROR: signed rseserver-*.zip not found!'
|
||||
echo "Please sign a server zip on build.eclipse.org, upload and retry."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d ${TMP} ]; then
|
||||
mkdir -p ${TMP}
|
||||
if [ ! -d ${TMPD} ]; then
|
||||
mkdir -p ${TMPD}
|
||||
fi
|
||||
if [ ! -d ${OUTPUT} ]; then
|
||||
mkdir -p ${OUTPUT}
|
||||
|
@ -73,11 +133,12 @@ fi
|
|||
if [ ! -d ${RESULT} ]; then
|
||||
mkdir -p ${RESULT}
|
||||
fi
|
||||
cd ${DROPDIR}
|
||||
for zip in `ls *.zip *.tar` ; do
|
||||
cd ${TMP}
|
||||
cd ${TMPD}
|
||||
case ${zip} in
|
||||
*.zip) unzip -q ${curdir}/${zip} ;;
|
||||
*.tar) tar xf ${curdir}/${zip} ;;
|
||||
*.zip) unzip -q ${DROPDIR}/${zip} ;;
|
||||
*.tar) tar xf ${DROPDIR}/${zip} ;;
|
||||
esac
|
||||
case ${zip} in
|
||||
rseserver*) SIGNED_JARS=${SIGNED_JAR_SOURCE}/server ;;
|
||||
|
@ -105,7 +166,10 @@ for zip in `ls *.zip *.tar` ; do
|
|||
*.tar) tar cfv ${OUTPUT}/${zip} * ; touch -r ${REF} ${OUTPUT}/${zip};
|
||||
esac
|
||||
rm -rf *
|
||||
rm "${OUTPUT}"/rseserver-*-signed.zip
|
||||
signed_server=`ls "${OUTPUT}" | grep 'rseserver-.*-signed\.zip'`
|
||||
if [ "${signed_server}" != "" ]; then
|
||||
rm "${OUTPUT}/${signed_server}"
|
||||
fi
|
||||
cd ${RESULT}
|
||||
case ${zip} in
|
||||
rseserver*) mkdir ${zip} ; cd ${zip} ;
|
||||
|
@ -117,16 +181,28 @@ for zip in `ls *.zip *.tar` ; do
|
|||
*) unzip -q -o ${OUTPUT}/${zip} ;;
|
||||
esac
|
||||
done
|
||||
rm -rf ${TMP}
|
||||
rm -rf ${TMPD}
|
||||
|
||||
echo "--------------------------------------"
|
||||
echo "DONE"
|
||||
echo "--------------------------------------"
|
||||
cd "${curdir}"
|
||||
cd "${DROPDIR}"
|
||||
echo "MAIN:---------------------------------"
|
||||
diff -r ${RESULT} ${SIGNED_JAR_SOURCE}
|
||||
for f in `ls rseserver-*.zip rseserver-*.tar` ; do
|
||||
echo "${f}:-----------------------------------"
|
||||
diff -r -b ${RESULT}/${f} ${SIGNED_JAR_SOURCE}/server
|
||||
done
|
||||
cd "${curdir}"
|
||||
echo ""
|
||||
echo "ls ${OUTPUT}"
|
||||
ls ${OUTPUT}
|
||||
echo ""
|
||||
if [ ! -d ${DROPDIR}.unsigned ]; then
|
||||
echo "cp -Rp ${DROPDIR} ${DROPDIR}.unsigned"
|
||||
echo "chmod -R g+w ${DROPDIR}.unsigned"
|
||||
fi
|
||||
echo "cp -f ${OUTPUT}/* ${DROPDIR}"
|
||||
echo "rm -rf ${DROPDIR}/signed"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue