Weitere Modifikation des BUILD Systems sowie
Abschluss des Teils 2 eines neuen Installationssystems * Klasse packaging/Load um einen parameter packagekeys-file erweitert, durch den die Liste der zu installierenden Module übergeben werden kann (anstelle von Command Line Parameter) * deploy step erstellt in WEB-INF/bin/bundle/cfg eine Datei mit den zu installierenden Modulen (extrahiert aus project.xml), die den Angaben auf der Komandozeile entspricht * load-bundle modifiziert, so dass die Module nun per Datei und nicht mehr als Parameter übergeben werden. * Script ccm modifiziert, dass es ein neue Kommande *prepare* gibt, das den load step mit den für eine Erstinstallation notwendigen Parametern aufruft. * JDBC Treiber aktualisiert. Damit ist ein neues Installationstool bis Schritt 2 (ccm-prep tool) realisiert. Ablauf: * Installation des war Files in Tomcat * Aufruf ccm prepare aus Verzeichnis WEB-INF/bin heraus * Eintragen der notwendigen Parameter in dem Menüsystem * Abschliessen mit "e". * Starten Tomcat git-svn-id: https://svn.libreccm.org/ccm/trunk@1059 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
98141ba556
commit
3a43e3df6a
|
|
@ -10,16 +10,33 @@
|
|||
# PATH, you have to adjust the paths.
|
||||
CCM_LIB_DIR="../lib"
|
||||
CCM_HOME_DIR="../.."
|
||||
# Path of the lib directory of the Tomcat Server which runs the CCM installation.
|
||||
# If the CATALINA_HOME enviroment variable is not set on your system you have
|
||||
# either to set this environment variable (recommened)
|
||||
# to adjust this path to point to the lib directory of your Tomcat installation
|
||||
# (if you installed the Tomcat using the package manager of your distribution
|
||||
# this is usally /usr/share/tomcat6/lib)
|
||||
# To set an environment variable you have usally to add an file to the /etc/profile.d
|
||||
# directory, for example tomcat.sh. In this file, you can set environment variables
|
||||
# using the 'export' command. This line might look like this:
|
||||
# export CATALINA_HOME=/usr/share/tomcat6/lib
|
||||
|
||||
# We need CATALINA_HOME environment variable to access Tomcat's lib dir.
|
||||
if [[ -z "$CATALINA_HOME" ]] ; then
|
||||
echo CATALINE_HOME not set. Guessing ...
|
||||
|
||||
if [ -f /etc/tomcat6/tomcat6.conf ]
|
||||
then
|
||||
. /etc/tomcat6/tomcat6.conf
|
||||
echo
|
||||
echo Using CATALINA_HOME = $CATALINA_HOME
|
||||
echo If this doesn\'t work use
|
||||
echo export CATALINA_HOME=/path/to/tomcat/installation
|
||||
echo to point us to the correct location.
|
||||
else
|
||||
echo
|
||||
echo ===================================================
|
||||
echo Environment variable CATALINA_HOME not set. We need
|
||||
echo to know the location of Tomcat\'s lib directory.
|
||||
echo So use
|
||||
echo export CATALINA_HOME=/path/to/tomcat/installation
|
||||
echo to point us to the correct location and run ccm
|
||||
echo again.
|
||||
echo ===================================================
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
CATALINA_LIB_DIR="${CATALINA_HOME}/lib"
|
||||
|
||||
# Script logic starts here
|
||||
|
|
@ -32,9 +49,9 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d ${CCM_HOME_DIR}/__ccm__ ]
|
||||
if [ ! -d ${CCM_HOME_DIR}/WEB-INF ]
|
||||
then
|
||||
echo "Error: CCM_HOME_DIR path is invalid \(no __ccm__ directory in CCM_HOME_DIR\)."
|
||||
echo "Error: CCM_HOME_DIR path is invalid \(no WEB-INF directory in CCM_HOME_DIR\)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -48,4 +65,16 @@ fi
|
|||
CCM_HOME_DIR=`cd ${CCM_HOME_DIR}; pwd`
|
||||
|
||||
echo "Starting CCM-Tool..."
|
||||
java -cp ${CCM_LIB_DIR}/"*":${CATALINA_LIB_DIR}/"*" -Dccm.home=${CCM_HOME_DIR} "com.arsdigita.packaging.MasterTool" "$@"
|
||||
if [ "$1" = "prepare" ] ; then
|
||||
echo
|
||||
echo =====================================
|
||||
echo $1:
|
||||
echo - Initializes ccm after installation.
|
||||
echo - Execute only ONCE!
|
||||
echo =====================================
|
||||
echo
|
||||
param="load --interactive --packagekeys-file bundle/cfg/package-key.list --parameter-file bundle/cfg/integration.properties"
|
||||
java -cp ${CCM_LIB_DIR}/"*":${CATALINA_LIB_DIR}/"*" -Dccm.home=${CCM_HOME_DIR} "com.arsdigita.packaging.MasterTool" $param
|
||||
else
|
||||
java -cp ${CCM_LIB_DIR}/"*":${CATALINA_LIB_DIR}/"*" -Dccm.home=${CCM_HOME_DIR} "com.arsdigita.packaging.MasterTool" "$@"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,48 +1,51 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
# This script is a wrapper for calling the CCM commandline utilites
|
||||
# used for maintence of a CCM installation.
|
||||
|
||||
if [ -z "$CCM_HOME" ]
|
||||
# Variables for directories.
|
||||
# The path are relative to the bin directory of the CCM installation. This
|
||||
# means that this script has to be executed from the bin directory. If you
|
||||
# want to use this script from another directory, or include it into your
|
||||
# PATH, you have to adjust the paths.
|
||||
CCM_LIB_DIR="../lib"
|
||||
CCM_HOME_DIR="../.."
|
||||
# Path of the lib directory of the Tomcat Server which runs the CCM installation.
|
||||
# If the CATALINA_HOME enviroment variable is not set on your system you have
|
||||
# either to set this environment variable (recommened)
|
||||
# to adjust this path to point to the lib directory of your Tomcat installation
|
||||
# (if you installed the Tomcat using the package manager of your distribution
|
||||
# this is usally /usr/share/tomcat6/lib)
|
||||
# To set an environment variable you have usally to add an file to the /etc/profile.d
|
||||
# directory, for example tomcat.sh. In this file, you can set environment variables
|
||||
# using the 'export' command. This line might look like this:
|
||||
# export CATALINA_HOME=/usr/share/tomcat6/lib
|
||||
CATALINA_LIB_DIR="${CATALINA_HOME}/lib"
|
||||
|
||||
# Script logic starts here
|
||||
echo "checking if all paths are correct..."
|
||||
files=$(ls ${CCM_LIB_DIR}/ccm-core*.jar 2> /dev/null | wc -l)
|
||||
|
||||
if [ "$files" == "0" ]
|
||||
then
|
||||
return 1
|
||||
echo "Error: CCM_LIB_DIR is invalid \(no ccm-core*.jar file\(s\) in CCM_LIB_DIR\)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# System values
|
||||
[ -f "/etc/ccm/ccm.conf" ] && . "/etc/ccm/ccm.conf"
|
||||
|
||||
# Optional server-specific values
|
||||
[ -f "$CCM_HOME/conf/ccm.conf" ] && . "$CCM_HOME/conf/ccm.conf"
|
||||
|
||||
if [ -z "$CCM_CLASSPATH" ]
|
||||
if [ ! -d ${CCM_HOME_DIR}/__ccm__ ]
|
||||
then
|
||||
|
||||
CCM_CLASSPATH="$CCM_CLASSPATH_CUSTOM"
|
||||
|
||||
for dir in `ls -d $CCM_HOME/conf/*`
|
||||
do
|
||||
CCM_CLASSPATH=$CCM_CLASSPATH:$dir
|
||||
done
|
||||
|
||||
if [ -n "$CCM_APPS" ]
|
||||
then
|
||||
for APP in $CCM_APPS
|
||||
do
|
||||
[ -f "/usr/share/java/$APP.jar" ] && CCM_CLASSPATH="$CCM_CLASSPATH:/usr/share/java/$APP.jar"
|
||||
if [ -d "/usr/share/java/$APP" ]
|
||||
then
|
||||
for file in `ls /usr/share/java/$APP`
|
||||
do
|
||||
CCM_CLASSPATH=$CCM_CLASSPATH:/usr/share/java/$APP/$file
|
||||
done
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo foo
|
||||
fi
|
||||
echo "Error: CCM_HOME_DIR path is invalid \(no __ccm__ directory in CCM_HOME_DIR\)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CCM_CLASSPATH=`echo $CCM_CLASSPATH | sed -e 's/::/:/g' | sed -e 's/:$//' | sed -e 's/^://'`
|
||||
if [ ! -f ${CATALINA_LIB_DIR}/catalina.jar ]
|
||||
then
|
||||
echo "Error: CATALINA_LIB_DIR is invalid \(no catalina.jar in CATALINA_LIB_DIR\)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo $CCM_CLASSPATH | tr : "\n"
|
||||
#Convert to absolute path:
|
||||
CCM_HOME_DIR=`cd ${CCM_HOME_DIR}; pwd`
|
||||
|
||||
java -cp $CCM_CLASSPATH -Dccm.home=$CCM_HOME "$@"
|
||||
echo "executing ccm-run"
|
||||
java -cp ${CCM_LIB_DIR}/"*":${CATALINA_LIB_DIR}/"*" -Dccm.home=${CCM_HOME_DIR} "$@"
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
if [ -z "$CCM_HOME" ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# System values
|
||||
[ -f "/etc/ccm/ccm.conf" ] && . "/etc/ccm/ccm.conf"
|
||||
|
||||
# Optional server-specific values
|
||||
[ -f "$CCM_HOME/conf/ccm.conf" ] && . "$CCM_HOME/conf/ccm.conf"
|
||||
|
||||
if [ -z "$CCM_CLASSPATH" ]
|
||||
then
|
||||
|
||||
CCM_CLASSPATH="$CCM_CLASSPATH_CUSTOM"
|
||||
|
||||
for dir in `ls -d $CCM_HOME/conf/*`
|
||||
do
|
||||
CCM_CLASSPATH=$CCM_CLASSPATH:$dir
|
||||
done
|
||||
|
||||
if [ -n "$CCM_APPS" ]
|
||||
then
|
||||
for APP in $CCM_APPS
|
||||
do
|
||||
[ -f "/usr/share/java/$APP.jar" ] && CCM_CLASSPATH="$CCM_CLASSPATH:/usr/share/java/$APP.jar"
|
||||
if [ -d "/usr/share/java/$APP" ]
|
||||
then
|
||||
for file in `ls /usr/share/java/$APP`
|
||||
do
|
||||
CCM_CLASSPATH=$CCM_CLASSPATH:/usr/share/java/$APP/$file
|
||||
done
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo foo
|
||||
fi
|
||||
fi
|
||||
|
||||
CCM_CLASSPATH=`echo $CCM_CLASSPATH | sed -e 's/::/:/g' | sed -e 's/:$//' | sed -e 's/^://'`
|
||||
|
||||
echo $CCM_CLASSPATH | tr : "\n"
|
||||
|
||||
java -cp $CCM_CLASSPATH -Dccm.home=$CCM_HOME "$@"
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script is a wrapper for calling the CCM commandline utilites
|
||||
# used for maintence of a CCM installation.
|
||||
|
||||
# Variables for directories.
|
||||
# The path are relative to the bin directory of the CCM installation. This
|
||||
# means that this script has to be executed from the bin directory. If you
|
||||
# want to use this script from another directory, or include it into your
|
||||
# PATH, you have to adjust the paths.
|
||||
CCM_LIB_DIR="../lib"
|
||||
CCM_HOME_DIR="../.."
|
||||
# Path of the lib directory of the Tomcat Server which runs the CCM installation.
|
||||
# If the CATALINA_HOME enviroment variable is not set on your system you have
|
||||
# either to set this environment variable (recommened)
|
||||
# to adjust this path to point to the lib directory of your Tomcat installation
|
||||
# (if you installed the Tomcat using the package manager of your distribution
|
||||
# this is usally /usr/share/tomcat6/lib)
|
||||
# To set an environment variable you have usally to add an file to the /etc/profile.d
|
||||
# directory, for example tomcat.sh. In this file, you can set environment variables
|
||||
# using the 'export' command. This line might look like this:
|
||||
# export CATALINA_HOME=/usr/share/tomcat6/lib
|
||||
CATALINA_LIB_DIR="${CATALINA_HOME}/lib"
|
||||
|
||||
# Script logic starts here
|
||||
echo "checking if all paths are correct..."
|
||||
files=$(ls ${CCM_LIB_DIR}/ccm-core*.jar 2> /dev/null | wc -l)
|
||||
|
||||
if [ "$files" == "0" ]
|
||||
then
|
||||
echo "Error: CCM_LIB_DIR is invalid \(no ccm-core*.jar file\(s\) in CCM_LIB_DIR\)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d ${CCM_HOME_DIR}/__ccm__ ]
|
||||
then
|
||||
echo "Error: CCM_HOME_DIR path is invalid \(no __ccm__ directory in CCM_HOME_DIR\)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f ${CATALINA_LIB_DIR}/catalina.jar ]
|
||||
then
|
||||
echo "Error: CATALINA_LIB_DIR is invalid \(no catalina.jar in CATALINA_LIB_DIR\)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#Convert to absolute path:
|
||||
CCM_HOME_DIR=`cd ${CCM_HOME_DIR}; pwd`
|
||||
|
||||
echo "executing ccm-run"
|
||||
java -cp ${CCM_LIB_DIR}/"*":${CATALINA_LIB_DIR}/"*" -Dccm.home=${CCM_HOME_DIR} "$@"
|
||||
|
|
@ -1,348 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
#NAME
|
||||
# deploy2jboss.sh - deploy CCM webapps under JBoss AS 4.0.5 4.2.0
|
||||
#
|
||||
#SYNOPSIS
|
||||
# deploy2jboss.sh [--force] service_name [source_server_configuration]"
|
||||
#
|
||||
#DESCRIPTION
|
||||
# jbossas RPM/Red Hat Application Stack (JBOSS_HOME not set)
|
||||
# Creates new SysV service and JBoss AS server configuration based on
|
||||
# source JBoss server configuration ( 'default' if not specified ).
|
||||
# If JBOSS_HOME is set, normal JBoss installation is assumed
|
||||
# and shell startup script is created in $JBOSS_HOME/bin
|
||||
|
||||
# Requires: getopt sed jar java
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [--force] service_name [source_server_configuration]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
OPTS=`getopt -o f -l force -- "$@"`
|
||||
if (($?)); then usage; fi
|
||||
eval set -- "$OPTS"
|
||||
FORCE=0
|
||||
while true; do
|
||||
case "$1" in
|
||||
-f|--force) FORCE=1; shift;;
|
||||
--) shift; break;;
|
||||
*) usage;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test -z "$1"; then
|
||||
usage
|
||||
fi
|
||||
JBOSSCONF=$1
|
||||
SRCCONF=${2:-default}
|
||||
|
||||
if [[ -z "$JBOSS_HOME" ]]; then
|
||||
# JBoss paths for Red Hat Application Stack
|
||||
JBOSS_HOME=/var/lib/jbossas
|
||||
LOGDIR=/var/log/$JBOSSCONF
|
||||
CONFDIR=/etc/jbossas
|
||||
JBOSSUS=servlet
|
||||
JBOSSGR=servlet
|
||||
APPSTK=1
|
||||
else
|
||||
APPSTK=0
|
||||
fi
|
||||
|
||||
SUPPORTED_JBASVERS="4.0.5 4.2.0"
|
||||
JBASVER=`java -jar $JBOSS_HOME/bin/run.jar -V|head -1|cut -d' ' -f2`
|
||||
UNSUPPORTED=1
|
||||
for v in $SUPPORTED_JBASVERS; do
|
||||
if [[ $JBASVER =~ $v ]]; then
|
||||
UNSUPPORTED=0
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if (($UNSUPPORTED)); then
|
||||
echo "JBoss AS version $JBASVER not supported. Please use one of $SUPPORTED_JBASVERS"
|
||||
exit 1
|
||||
fi
|
||||
if test ! -d $JBOSS_HOME/server/$SRCCONF; then
|
||||
echo "server configuraton '$SRCCONF' doesn't exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Deploying CCM_HOME=$CCM_HOME to JBOSS_HOME=$JBOSS_HOME/server/$JBOSSCONF"
|
||||
if (($APPSTK)); then
|
||||
echo "Application Stack detected"
|
||||
fi
|
||||
|
||||
# jboss.server.home.url
|
||||
cd $JBOSS_HOME/server
|
||||
if test -d $JBOSSCONF; then
|
||||
echo -n "'$JBOSSCONF' already there, "
|
||||
if (($FORCE)); then
|
||||
echo -n "updating from '$SRCCONF'..."
|
||||
rm -rf $JBOSSCONF
|
||||
else
|
||||
echo "aborting, use --force"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo -n "creating '$JBOSSCONF' from '$SRCCONF'..."
|
||||
fi
|
||||
|
||||
mkdir $JBOSSCONF
|
||||
cd $JBOSSCONF
|
||||
mkdir data
|
||||
mkdir tmp
|
||||
mkdir work
|
||||
cp -rd --preserve=mode,timestamps $JBOSS_HOME/server/$SRCCONF/deploy .
|
||||
cp -rd --preserve=mode,timestamps $JBOSS_HOME/server/$SRCCONF/lib .
|
||||
|
||||
# JBoss options run.conf or rpmized /etc/jbossas/...
|
||||
cat > /tmp/jbossconf$$.sed <<EOF
|
||||
/JBOSSCONF=/c\\
|
||||
JBOSSCONF="$JBOSSCONF"
|
||||
/JBOSSUS=/c\\
|
||||
JBOSSUS="$JBOSSUS"
|
||||
/JBOSSGR=/c\\
|
||||
JBOSSGR="$JBOSSGR"
|
||||
\$a\\
|
||||
JAVA_OPTS="-Xms512m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Duser.language=en -Duser.country=US -Dccm.home=$CCM_HOME"
|
||||
EOF
|
||||
# XXX -Duser.* -> LANG=en_US.UTF-8 workaround for ChainedResourceBundle
|
||||
# Sun JDK JMX agent: -Dcom.sun.management.jmxremote
|
||||
# JRockit Tools: -Xmanagement
|
||||
# debugger: -Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:8787,server=y,suspend=n
|
||||
|
||||
if (($APPSTK)); then
|
||||
# create new SysV service based on jbossas
|
||||
cd /etc/init.d/
|
||||
if (($FORCE)); then
|
||||
rm $JBOSSCONF
|
||||
fi
|
||||
if test ! -e $JBOSSCONF; then
|
||||
ln -s jbossas $JBOSSCONF
|
||||
fi
|
||||
cd /etc/sysconfig/
|
||||
if (($FORCE)); then
|
||||
rm $JBOSSCONF
|
||||
fi
|
||||
if test ! -e $JBOSSCONF; then
|
||||
cp jbossas $JBOSSCONF
|
||||
sed -i -f /tmp/jbossconf$$.sed $JBOSSCONF
|
||||
fi
|
||||
# jboss.server.log.dir
|
||||
cd $LOGDIR
|
||||
# re-create logdir on each deployment
|
||||
rm -rf $JBOSSCONF
|
||||
mkdir $JBOSSCONF
|
||||
chown $JBOSSUS:$JBOSSGR $JBOSSCONF
|
||||
|
||||
cd $JBOSS_HOME/server/$JBOSSCONF
|
||||
chown $JBOSSUS:$JBOSSGR data
|
||||
chown $JBOSSUS:$JBOSSGR tmp
|
||||
chown $JBOSSUS:$JBOSSGR work
|
||||
|
||||
if test ! -e log; then
|
||||
ln -s $LOGDIR/$JBOSSCONF log
|
||||
fi
|
||||
if test ! -e conf; then
|
||||
ln -s $CONFDIR/$JBOSSCONF conf
|
||||
fi
|
||||
|
||||
else
|
||||
cd $JBOSS_HOME/bin
|
||||
rm -f $JBOSSCONF.conf
|
||||
cp run.conf $JBOSSCONF.conf
|
||||
sed -i -f /tmp/jbossconf$$.sed $JBOSSCONF.conf
|
||||
cd $JBOSS_HOME/server/$JBOSSCONF
|
||||
cp -rd --preserve=mode,timestamps $JBOSS_HOME/server/$SRCCONF/conf .
|
||||
mkdir log
|
||||
fi
|
||||
rm /tmp/jbossconf$$.sed
|
||||
|
||||
# customize default JBoss services
|
||||
if test -d deploy/jbossweb-tomcat55.sar/; then
|
||||
# JBAS4.0.5 w/ Tomcat5.5 in jbossweb-tomcat55.sar
|
||||
cd deploy/jbossweb-tomcat55.sar/
|
||||
elif test -d deploy/jboss-web.deployer/; then
|
||||
# JBAS4.2.0 w/ Tomcat6.0 in jboss-web.deployer
|
||||
cd deploy/jboss-web.deployer/
|
||||
else
|
||||
echo "Tomcat not found in $SRCCONF. Please re-install JBoss AS or choose different source server configuration."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# rename Tomcat's default ROOT webapp
|
||||
mv ROOT.war jbossweb.war
|
||||
sed -i 's/href="\/status/href="status/' jbossweb.war/index.html
|
||||
|
||||
echo "done."
|
||||
|
||||
# WEBAPPS
|
||||
# $JBOSSCONF/deploy/
|
||||
cd ..
|
||||
# TODO option to deploy webapps directly from ccm-* RPMs
|
||||
# ( /usr/share/java/webapps/ccm-*/ )
|
||||
# NB: default p2fs destinations in com.arsdigita.cms.enterprise.init:
|
||||
# {ccm.home}data/p2fs and
|
||||
# {ccm.home}webapps/ROOT/packages/content-section/templates
|
||||
|
||||
# Use hostinit-ed CCM_HOME
|
||||
for ccmwebapp in $CCM_HOME/webapps/ccm-*; do
|
||||
name=$(basename $ccmwebapp)
|
||||
ln -s $ccmwebapp $name.war
|
||||
done
|
||||
ln -s $CCM_HOME/webapps/ROOT ROOT.war
|
||||
|
||||
# JARs
|
||||
function extract_pkgs() {
|
||||
pkgs=$(jar tf $1 |sed -rn '/^.+-INF/d;/\.class$/{s/\/[^\/]+\.class$//;p}' |sort -u)
|
||||
}
|
||||
|
||||
# shared CL location
|
||||
# $JBOSSCONF/lib/
|
||||
cd ../lib
|
||||
# development environment CCM_HOME
|
||||
if test -d $CCM_HOME/webapps/WEB-INF/classes; then
|
||||
echo -n "creating JAR from $CCM_HOME/webapps/WEB-INF/classes..."
|
||||
jar cf ccm-ALL.jar -C $CCM_HOME/webapps/WEB-INF/classes .
|
||||
echo "done."
|
||||
fi
|
||||
deployedpkgs=""
|
||||
echo -n "Analyzing JBossAS JARs: "
|
||||
for deployedjar in *jar $JBOSS_HOME/lib/endorsed/*jar; do
|
||||
echo -n "$deployedjar "
|
||||
extract_pkgs $deployedjar
|
||||
deployedpkgs="$deployedpkgs $pkgs"
|
||||
done
|
||||
echo "done."
|
||||
|
||||
# JAR conflict resolution: JBoss JARs have precedence
|
||||
for ccmjar in $CCM_HOME/webapps/WEB-INF/lib/*jar; do
|
||||
ccmjarbase=$(basename $ccmjar)
|
||||
if test ${ccmjarbase:0:3} = "ccm"; then
|
||||
ln -sf $ccmjar .
|
||||
else
|
||||
extract_pkgs $ccmjar
|
||||
conflicts=0
|
||||
for pkg in $pkgs; do
|
||||
if [[ $deployedpkgs =~ $pkg ]]; then
|
||||
echo -n "$pkg CONFLICT "
|
||||
conflicts=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
if (($conflicts)); then
|
||||
echo "skipping $ccmjar"
|
||||
else
|
||||
ln -sf $ccmjar .
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Add JDBC JARs
|
||||
# use ccm-java RPM configuration if present
|
||||
if test -e /etc/sysconfig/ccm-java; then
|
||||
. /etc/sysconfig/ccm-java
|
||||
if [[ -r "$ORACLE" ]]; then
|
||||
ln -sf "$ORACLE" .
|
||||
else
|
||||
echo "Warning: Oracle JDBC JAR not found"
|
||||
fi
|
||||
if [[ -r "$POSTGRES" ]]; then
|
||||
ln -sf "$POSTGRES" .
|
||||
else
|
||||
echo "Warning: PostgreSQL JDBC JAR not found"
|
||||
fi
|
||||
else
|
||||
# no ccm-java, assume CCM dev.env.
|
||||
# CLASSPATH which should include Oracle or PostgreSQL JDBC JAR
|
||||
# set by ccm-profile
|
||||
nojdbc=1
|
||||
IFS=:
|
||||
for c in $CLASSPATH; do
|
||||
if [[ $c =~ oracle ]] || [[ $c =~ postgresql ]]; then
|
||||
if [[ -r $c ]]; then
|
||||
ln -sf "$c" .
|
||||
nojdbc=0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS=
|
||||
if (($nojdbc)); then
|
||||
echo "Warning: JDBC JAR not found"
|
||||
fi
|
||||
fi
|
||||
|
||||
if (($APPSTK)); then
|
||||
cd $CONFDIR
|
||||
# jboss.server.config.url
|
||||
if (($FORCE)); then
|
||||
rm -rf $JBOSSCONF
|
||||
fi
|
||||
if test ! -d $JBOSSCONF; then
|
||||
cp -rd --preserve=mode,timestamps $SRCCONF $JBOSSCONF
|
||||
fi
|
||||
cd $JBOSSCONF
|
||||
else
|
||||
cd $JBOSS_HOME/server/$JBOSSCONF/conf
|
||||
fi
|
||||
|
||||
if test -e jboss-log4j.xml; then
|
||||
# JBAS4.2
|
||||
LOG4J=jboss-log4j.xml
|
||||
else
|
||||
LOG4J=log4j.xml
|
||||
fi
|
||||
|
||||
# CCM log4j and XML/XSLT configuration is not used
|
||||
if test ! -e $LOG4J.CCM; then
|
||||
# 1st time, modify JBoss log4j config to suppress verbose CCM logging
|
||||
|
||||
sed -iCCM '/^.*Limit the org.apache category to INFO as its DEBUG is verbose/i\
|
||||
<category name="com.redhat.persistence">\
|
||||
<priority value="WARN"/>\
|
||||
</category>\
|
||||
<category name="com.arsdigita.runtime.Startup">\
|
||||
<priority value="INFO"/>\
|
||||
</category>\
|
||||
<category name="com.arsdigita.packaging.Loader">\
|
||||
<priority value="INFO"/>\
|
||||
</category>\
|
||||
<category name="com.arsdigita">\
|
||||
<priority value="WARN"/>\
|
||||
</category>\
|
||||
<category name="org.jboss">\
|
||||
<priority value="INFO"/>\
|
||||
</category>\
|
||||
<!-- Redirect/LoginSignal -->\
|
||||
<category name="org.apache.catalina.core.ContainerBase">\
|
||||
<priority value="FATAL"/>\
|
||||
</category>\
|
||||
' $LOG4J
|
||||
sed -i '/<root>/a\
|
||||
<priority value="INFO" />' $LOG4J
|
||||
fi
|
||||
|
||||
echo -n "To start APLAWS use: "
|
||||
if (($APPSTK)); then
|
||||
echo "service $JBOSSCONF start"
|
||||
else
|
||||
startup_script="$JBOSS_HOME/bin/$JBOSSCONF.sh"
|
||||
echo "RUN_CONF=$JBOSS_HOME/bin/$JBOSSCONF.conf $JBOSS_HOME/bin/run.sh -c $JBOSSCONF" > "$startup_script"
|
||||
echo "$startup_script"
|
||||
fi
|
||||
|
||||
# example cmdln with ccm start:
|
||||
# -Dccm.home=/usr/share/ccm -Dccm.conf=/usr/share/ccm/conf/registry -Dcom.arsdigita.util.Assert.enabled=true -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.transform.TransformerFactory=com.icl.saxon.TransformerFactoryImpl -Djava.protocol.handler.pkgs=com.arsdigita.util.protocol -Djava.ext.dirs=/opt/java/jdk/jre/lib/ext:/opt/java/jdk/lib/ext:/usr/share/ccm/webapps/WEB-INF/system -Dlog4j.configuration=file:///usr/share/ccm/conf/log4j.properties -Xms1024m -Xmx1024m -Dcom.sun.management.jmxremote
|
||||
|
||||
# NOTE about resource: URL protocol
|
||||
# JBoss has org.jboss.net.protocol.resource but it doesn't ignore
|
||||
# leading slashes like c.a.util.protocol.resource does.
|
||||
# Default parameter values are modified for JBoss handler on trunk r1346
|
||||
# so for JBoss webapps/WEB-INF/system/ccm-core-*-system.jar is not needed,
|
||||
# JBoss handler takes precedence anyway
|
||||
# XXX java.ext.dirs=...WEB-INF/system
|
||||
# XXX java.protocol.handler.pkgs=com.arsdigita.util.protocol
|
||||
|
||||
|
|
@ -39,6 +39,7 @@ import com.arsdigita.util.parameter.Parameter;
|
|||
import com.arsdigita.util.parameter.ParameterContext;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
|
@ -56,6 +57,7 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Scanner;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.commons.cli.OptionBuilder;
|
||||
|
|
@ -100,6 +102,13 @@ class Load extends Command {
|
|||
|
||||
static {
|
||||
logger.debug("Static initalizer starting...");
|
||||
OPTIONS.addOption
|
||||
(OptionBuilder
|
||||
.hasArg()
|
||||
.withLongOpt("packagekeys-file")
|
||||
.withArgName("FILE")
|
||||
.withDescription("Use PACKAGE_KEYS from FILE instead of command line")
|
||||
.create());
|
||||
OPTIONS.addOption
|
||||
(OptionBuilder
|
||||
.hasArg(false)
|
||||
|
|
@ -185,15 +194,32 @@ class Load extends Command {
|
|||
System.err.println(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// fill with command line arguments which is a list of packages by their
|
||||
// package-keys to load.
|
||||
List packages = line.getArgList();
|
||||
|
||||
if (line.hasOption("packagekeys-file")) {
|
||||
String file = line.getOptionValue("packagekeys-file");
|
||||
logger.debug("File with package keys: " + file );
|
||||
try {
|
||||
Scanner sc = new Scanner(new File(file));
|
||||
while (sc.hasNext()) {
|
||||
packages.add(sc.next());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.err.println(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (packages.isEmpty()) {
|
||||
usage(OPTIONS, System.err, "PACKAGE-KEYS");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (line.hasOption("usage") || line.hasOption("help")) {
|
||||
usage(OPTIONS, System.out, "PACKAGE-KEYS");
|
||||
return true;
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -1279,6 +1279,8 @@
|
|||
<available file="${{this.deploy.dir}}/WEB-INF/bin"/>
|
||||
</and>
|
||||
</condition>
|
||||
<property name="this.bundle.dir"
|
||||
value="${{this.deploy.dir}}/WEB-INF/bin/bundle" />
|
||||
<echo message="Bundle to use: ${{resolved.bundle.source.dir}}" />
|
||||
</target>
|
||||
|
||||
|
|
@ -1288,11 +1290,29 @@
|
|||
environment. -->
|
||||
<target name="copy-bundle"
|
||||
depends="init,copy-bundle-init" if="root.webapp.exists">
|
||||
|
||||
<!--
|
||||
<copy todir="${{this.deploy.dir}}/WEB-INF/bin/bundle" overwrite="yes">
|
||||
-->
|
||||
<copy todir="${{this.bundle.dir}}" overwrite="yes">
|
||||
<fileset dir="${{resolved.bundle.source.dir}}" />
|
||||
</copy>
|
||||
|
||||
<!-- Autogenerate from project.xml a file containing a space delimited
|
||||
list of package keys included in this build. Used during
|
||||
initialization of a *.war file distribution as simplification and
|
||||
replacement for a series of package keys as command line
|
||||
parameters by Load class (load-bundle step). -->
|
||||
<java classname="org.apache.xalan.xslt.Process" fork="yes" failonerror="true">
|
||||
<classpath refid="ccm.tools.classpath"/>
|
||||
<arg value="-IN"/>
|
||||
<arg value="${{this.deploy.dir}}/WEB-INF/bin/bundle/cfg/project.xml"/>
|
||||
<arg value="-OUT"/>
|
||||
<arg value="${{this.deploy.dir}}/WEB-INF/bin/bundle/cfg/package-key.list"/>
|
||||
<arg value="-XSL"/>
|
||||
<arg value="${{ccm.tools.xsl.dir}}/listapps.xsl"/>
|
||||
<arg value="-TEXT"/>
|
||||
</java>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- Master deploy -->
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@
|
|||
|
||||
<project name="load">
|
||||
|
||||
<target name="load-bundle" depends="prepare-load">
|
||||
<target name="load-bundle" depends="prepare-load">
|
||||
<echo>Loading bundle ${this.bundle.folder} into ${ccm.home}</echo>
|
||||
|
||||
<java classname="com.arsdigita.packaging.MasterTool" fork="true">
|
||||
<classpath refid="ccm.classpath" />
|
||||
<sysproperty key="ccm.home" value="${ccm.home}" />
|
||||
<arg line="load ${applications} --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
|
||||
<arg line="load --packagekeys-file ${this.bundle.folder}/cfg/package-key.list --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
|
||||
</java>
|
||||
</target>
|
||||
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
<java classname="com.arsdigita.packaging.MasterTool" fork="true">
|
||||
<classpath refid="ccm.classpath" />
|
||||
<sysproperty key="ccm.home" value="${ccm.home}" />
|
||||
<arg line="load ${applications} --interactive --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
|
||||
<arg line="load --packagekeys-file ${this.bundle.folder}/cfg/package-key.list --interactive --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
|
||||
</java>
|
||||
</target>
|
||||
|
||||
|
|
@ -187,17 +187,23 @@
|
|||
<filter token="new.app.name" value="${new.app.name}" />
|
||||
</filterset>
|
||||
</copy>
|
||||
<copy tofile="${new.app.name}/src/${new.app.name}.config" file="${ccm.project.dir}/tools-ng/ecdc/templates/new-app/src/new.app.name.config" preservelastmodified="true" verbose="true">
|
||||
<copy tofile="${new.app.name}/src/${new.app.name}.config"
|
||||
file="${ccm.project.dir}/tools-ng/ecdc/templates/new-app/src/new.app.name.config"
|
||||
preservelastmodified="true" verbose="true">
|
||||
<filterset>
|
||||
<filter token="new.app.name" value="${new.app.name}" />
|
||||
</filterset>
|
||||
</copy>
|
||||
<copy tofile="${new.app.name}/src/${new.app.name}.load" file="${ccm.project.dir}/tools-ng/ecdc/templates/new-app/src/new.app.name.load" preservelastmodified="true" verbose="true">
|
||||
<copy tofile="${new.app.name}/src/${new.app.name}.load"
|
||||
file="${ccm.project.dir}/tools-ng/ecdc/templates/new-app/src/new.app.name.load"
|
||||
preservelastmodified="true" verbose="true">
|
||||
<filterset>
|
||||
<filter token="new.app.name" value="${new.app.name}" />
|
||||
</filterset>
|
||||
</copy>
|
||||
<copy tofile="${new.app.name}/src/${new.app.name}.upgrade" file="${ccm.project.dir}/tools-ng/ecdc/templates/new-app/src/new.app.name.upgrade" preservelastmodified="true" verbose="true">
|
||||
<copy tofile="${new.app.name}/src/${new.app.name}.upgrade"
|
||||
file="${ccm.project.dir}/tools-ng/ecdc/templates/new-app/src/new.app.name.upgrade"
|
||||
preservelastmodified="true" verbose="true">
|
||||
<filterset>
|
||||
<filter token="new.app.name" value="${new.app.name}" />
|
||||
</filterset>
|
||||
|
|
|
|||
Loading…
Reference in New Issue