1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 12:35:22 +02:00
cdt/releng/org.eclipse.rse.releng.infocenter/update.sh

137 lines
4.4 KiB
Bash
Raw Normal View History

#!/bin/sh
2006-09-20 11:53:43 +00:00
#*******************************************************************************
2009-05-27 15:19:10 +00:00
# Copyright (c) 2006, 2009 Wind River Systems, Inc.
2006-09-20 11:53:43 +00:00
# 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
#*******************************************************************************
umask 022
2006-08-10 07:45:49 +00:00
echo "Infocenter Update: running as"
id
if [ "$IHOME" = "" ]; then
IHOME=/home/infocenter/latest
fi
2009-01-20 14:57:05 +00:00
ECL_DIR=$IHOME/eclipse
curdir=`pwd`
2009-01-15 15:14:58 +00:00
#update RSE into deployment directory
2009-01-20 16:09:35 +00:00
if [ ! -d $IHOME/deploy/rse ]; then
mkdir -p $IHOME/deploy/rse
fi
cd $IHOME/deploy/rse
2006-07-24 14:04:49 +00:00
rm *.zip
echo "Downloading RSE-SDK-latest.zip..."
wget -q "http://build.eclipse.org/dsdp/tm/downloads/drops/N.latest/RSE-SDK-latest.zip"
#wget -q "http://download.eclipse.org/dsdp/tm/downloads/drops/N.latest/RSE-SDK-latest.zip"
if [ -e RSE-SDK-latest.zip ]; then
echo "Unzipping..."
2006-07-24 14:04:49 +00:00
unzip -q RSE-SDK-latest.zip
if [ -e plugins.tmp ]; then
rm -rf plugins.tmp
fi
mkdir plugins.tmp
mv eclipse/plugins/*doc* plugins.tmp
rm -rf eclipse
NUM=`ls plugins.tmp/*.jar | wc -l`
echo "RSE plugins.tmp: NUM=$NUM"
if [ "$NUM" = "3" ]; then
echo "Doc plugins got successfully, installing from plugins.tmp into plugins..."
2006-07-24 14:04:49 +00:00
if [ -e plugins ]; then
rm -rf plugins
fi
mv plugins.tmp plugins
fi
2006-07-24 14:04:49 +00:00
else
echo "Error downloading RSE-SDK-latest.zip"
fi
2009-01-15 15:14:58 +00:00
#update MTJ into deployment directory
2009-01-20 16:09:35 +00:00
if [ ! -d $IHOME/deploy/mtj ]; then
mkdir -p $IHOME/deploy/mtj
fi
2009-01-15 15:14:58 +00:00
cd $IHOME/deploy/mtj
rm *.zip
echo "Downloading dsdp-mtj-SDK-incubation-latest.zip..."
2009-01-15 15:20:45 +00:00
#wget -q "http://build.eclipse.org/dsdp/mtj/downloads/drops/N.latest/dsdp-mtj-SDK-incubation-latest.zip"
wget -q "http://download.eclipse.org/dsdp/mtj/downloads/drops/N.latest/dsdp-mtj-SDK-incubation-latest.zip"
2009-01-15 15:14:58 +00:00
if [ -e dsdp-mtj-SDK-incubation-latest.zip ]; then
echo "Unzipping..."
unzip -q dsdp-mtj-SDK-incubation-latest.zip
if [ -e plugins.tmp ]; then
rm -rf plugins.tmp
fi
mkdir plugins.tmp
mv eclipse/plugins/*doc* plugins.tmp
rm -rf eclipse
NUM=`ls plugins.tmp/*.jar | wc -l`
echo "MTJ plugins.tmp: NUM=$NUM"
2009-01-20 14:57:05 +00:00
if [ "$NUM" = "2" -o "$NUM" = "1" ]; then
2009-01-15 15:14:58 +00:00
echo "Doc plugins got successfully, installing from plugins.tmp into plugins..."
if [ -e plugins ]; then
rm -rf plugins
fi
mv plugins.tmp plugins
fi
else
echo "Error downloading dsdp-mtj-SDK-incubation-latest.zip"
fi
2009-01-20 16:09:35 +00:00
######################### Deploy all #############################
echo "Deploying new plug-ins..."
NEED_RESTART=0
for COMP in rse dd.dsf nab ercp mtj ; do
if [ -d "${IHOME}/deploy/${COMP}/plugins" ]; then
if [ -d "$ECL_DIR/eclipse/dropins/${COMP}/eclipse/plugins" ]; then
diff -r "${IHOME}/deploy/${COMP}/plugins" "$ECL_DIR/eclipse/dropins/${COMP}/eclipse/plugins" >/dev/null
result=$?
if [ "${result}" != "0" ]; then
2009-01-20 17:01:18 +00:00
echo "${COMP} diffs as ${result} --> deploying"
2009-01-20 16:09:35 +00:00
NEED_RESTART=1
2009-01-20 17:01:18 +00:00
else
echo "${COMP} is unchanged"
2009-01-20 16:09:35 +00:00
fi
else
echo "${COMP} is NEW"
NEED_RESTART=1
fi
fi
done
######################### Restart Infocenter #############################
#update Infocenter with latest deployable plug-ins
if [ "$NEED_RESTART" != "0" ]; then
echo "Shutting down infocenter..."
$IHOME/bin/infocenter.sh shutdown
2009-01-20 14:57:05 +00:00
for COMP in rse dd.dsf nab ercp mtj ; do
2009-01-20 16:09:35 +00:00
if [ -d "${IHOME}/deploy/${COMP}/plugins" ]; then
if [ -d "$ECL_DIR/eclipse/dropins/${COMP}/eclipse/plugins" ]; then
rm -rf "$ECL_DIR/eclipse/dropins/${COMP}"
fi
mkdir -p "$ECL_DIR/eclipse/dropins/${COMP}/eclipse"
cp -Rp $IHOME/deploy/${COMP}/plugins "$ECL_DIR/eclipse/dropins/${COMP}/eclipse/"
fi
2009-01-20 14:57:05 +00:00
done
#TODO: not sure if we need to delete the old index to force re-indexing
echo "Deleting old index..."
rm -rf $IHOME/config/org.eclipse.help.base
cd $IHOME
echo "Restarting infocenter..."
nohup $IHOME/bin/infocenter.sh start &
echo "Waiting for Infocenter / Apache to come up [60 seconds]"
sleep 60
echo "Doing fake search to force rebuilding index"
2006-07-24 14:04:49 +00:00
wget -q "http://localhost/help/latest/advanced/searchView.jsp?searchWord=SystemBasePlugin&maxHits=2" -O search.out.jsp -t 3 --waitretry=30
echo "Done, index should be up again!"
else
echo "Nothing new deployed, no restart necessary."
fi
cd "$curdir"