2004-04-09 00:27:28 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2004-04-09 10:11:57 -04:00
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
# To run this script on your machine you must:
|
2004-04-09 00:27:28 -04:00
|
|
|
#
|
2004-04-10 14:29:46 -04:00
|
|
|
# 1. export JAVA_HOME=/path/to/java
|
2004-04-09 10:11:57 -04:00
|
|
|
#
|
2004-04-10 14:29:46 -04:00
|
|
|
# 2. export MBOOT_HOME=~/mboot
|
|
|
|
#
|
2004-04-12 16:17:21 -04:00
|
|
|
# 3. export M2_HOME=~/maven
|
2004-04-09 10:11:57 -04:00
|
|
|
#
|
2004-04-12 16:17:21 -04:00
|
|
|
# 4. export PATH=$PATH:$MBOOT:$M2_HOME/bin
|
2004-04-09 10:11:57 -04:00
|
|
|
#
|
2004-04-10 14:29:46 -04:00
|
|
|
# 5. Your ~/build.properties must have: maven.repo.local = ~/path/to/repo
|
2004-04-09 10:11:57 -04:00
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------------------
|
2004-04-09 00:27:28 -04:00
|
|
|
|
2004-04-09 19:56:23 -04:00
|
|
|
export JAVA_HOME=/usr/local/java
|
|
|
|
export MBOOT_HOME=$HOME/mboot
|
2004-06-15 23:28:50 -04:00
|
|
|
export M2_HOME=$HOME/m2
|
2004-04-12 16:17:21 -04:00
|
|
|
export PATH=$PATH:$MBOOT_HOME:$M2_HOME/bin:$JAVA_HOME/bin
|
2004-04-09 19:56:23 -04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
|
2004-04-10 14:29:46 -04:00
|
|
|
CMD=$1
|
|
|
|
|
2004-07-17 21:22:49 -04:00
|
|
|
[ "$1" = "" ] && echo && echo "You must specify a checkout or update!" && echo && exit 1
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 23:27:04 -04:00
|
|
|
HOME_DIR=`pwd`
|
|
|
|
DATE=`date`
|
2004-06-15 23:28:50 -04:00
|
|
|
DIR=m2-build
|
2004-04-09 00:27:28 -04:00
|
|
|
REPO=maven-repo-local
|
2004-04-09 10:11:57 -04:00
|
|
|
FROM=jvanzyl@maven.org
|
2004-05-08 08:45:44 -04:00
|
|
|
#TO=maven2-user@lists.codehaus.org
|
2004-06-03 15:04:44 -04:00
|
|
|
TO=m2-dev@maven.apache.org
|
2004-04-10 14:29:46 -04:00
|
|
|
SCM_LOG=scm.log
|
2004-04-10 15:19:09 -04:00
|
|
|
TIMESTAMP=`date +%Y%M%d.%H%M%S`
|
2004-04-10 23:27:04 -04:00
|
|
|
DEPLOY_DIR=$HOME_DIR/public_html/m2
|
2004-04-10 23:41:23 -04:00
|
|
|
DEPLOY_SITE=http://www.codehaus.org/~jvanzyl/m2
|
2004-04-09 10:11:57 -04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# Wipe out the working directory and the repository and start entirely
|
|
|
|
# from scratch.
|
2004-04-09 00:27:28 -04:00
|
|
|
|
2004-04-09 10:11:57 -04:00
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
echo "From: $FROM" > log
|
|
|
|
echo "To: $TO" >> log
|
2004-05-07 22:27:28 -04:00
|
|
|
echo "Subject: [maven2 build] $DATE" >> log
|
2004-04-09 00:27:28 -04:00
|
|
|
echo "" >> log
|
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
export CVSROOT=:pserver:anoncvs@cvs.apache.org:/home/cvspublic
|
2004-04-09 00:27:28 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
(
|
|
|
|
if [ "$CMD" = "checkout" ]
|
|
|
|
then
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
rm -rf $DIR > /dev/null 2>&1
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
mkdir $DIR
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
rm -rf $REPO > /dev/null 2>&1
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
mkdir $REPO
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Performing a clean check out of maven-components ..."
|
|
|
|
echo
|
|
|
|
|
|
|
|
(
|
|
|
|
cd $DIR
|
|
|
|
|
2004-04-10 14:42:24 -04:00
|
|
|
cvs co maven-components > $HOME_DIR/$SCM_LOG 2>&1
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
echo "true" > $HOME_DIR/build_required
|
|
|
|
)
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
else
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
echo
|
|
|
|
echo "Performing an update of maven-components ..."
|
|
|
|
echo
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
(
|
|
|
|
cd $DIR/maven-components
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
cvs update -dP > $HOME_DIR/$SCM_LOG 2>&1
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
grep ^P $HOME_DIR/$SCM_LOG > /dev/null 2>&1
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
if [ "$?" = "1" ]
|
|
|
|
then
|
|
|
|
|
|
|
|
echo "false" > $HOME_DIR/build_required
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 14:42:24 -04:00
|
|
|
else
|
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
echo "true" > $HOME_DIR/build_required
|
2004-04-10 14:42:24 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
fi
|
2004-04-09 00:27:28 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
)
|
2004-04-10 14:29:46 -04:00
|
|
|
|
2004-04-10 15:01:31 -04:00
|
|
|
fi
|
2004-04-10 14:29:46 -04:00
|
|
|
|
|
|
|
BUILD_REQUIRED=`cat $HOME_DIR/build_required`
|
|
|
|
|
|
|
|
if [ "$BUILD_REQUIRED" = "true" ]
|
|
|
|
then
|
|
|
|
|
2004-04-10 14:48:13 -04:00
|
|
|
echo "Updates occured, build required ..."
|
|
|
|
echo
|
|
|
|
grep ^P $HOME_DIR/$SCM_LOG
|
|
|
|
echo
|
|
|
|
|
2004-04-10 14:29:46 -04:00
|
|
|
(
|
|
|
|
cd $DIR/maven-components/maven-core
|
|
|
|
|
2004-06-01 17:31:23 -04:00
|
|
|
./m2-bootstrap-all.sh
|
2004-04-10 15:19:09 -04:00
|
|
|
)
|
2004-04-10 18:04:27 -04:00
|
|
|
|
2004-04-10 23:39:14 -04:00
|
|
|
DIST=m2-${TIMESTAMP}.tar.gz
|
|
|
|
|
2004-04-10 18:04:27 -04:00
|
|
|
echo
|
2004-04-10 23:39:14 -04:00
|
|
|
echo "Creating m2 distribution for public consumption: ${DEPLOY_SITE}/${DIST}"
|
2004-04-10 18:04:27 -04:00
|
|
|
echo
|
2004-04-10 15:24:38 -04:00
|
|
|
|
|
|
|
(
|
|
|
|
cd $DIR/maven-components/maven-core/dist
|
|
|
|
|
2004-04-10 23:39:14 -04:00
|
|
|
tar czf $DIST m2
|
2004-04-10 15:24:38 -04:00
|
|
|
|
2004-04-10 23:39:14 -04:00
|
|
|
cp $DIST $DEPLOY_DIR
|
2004-04-10 15:24:38 -04:00
|
|
|
)
|
2004-04-10 15:19:09 -04:00
|
|
|
|
2004-04-10 14:29:46 -04:00
|
|
|
else
|
|
|
|
|
2004-04-10 14:48:13 -04:00
|
|
|
echo "No updates occured, no build required. Done."
|
2004-04-10 14:29:46 -04:00
|
|
|
|
|
|
|
fi
|
|
|
|
|
2004-04-09 00:27:28 -04:00
|
|
|
) >> log 2>&1
|
|
|
|
|
2004-04-11 12:31:25 -04:00
|
|
|
BUILD_REQUIRED=`cat $HOME_DIR/build_required`
|
|
|
|
|
|
|
|
# Only send mail to the list if a build was required.
|
|
|
|
|
2004-06-28 00:38:37 -04:00
|
|
|
host=`hostname`
|
|
|
|
|
2004-04-11 12:31:25 -04:00
|
|
|
if [ "$BUILD_REQUIRED" = "true" ]
|
|
|
|
then
|
2004-06-28 00:38:37 -04:00
|
|
|
if [ "$hostname" = "beaver.codehaus.org" ]
|
|
|
|
then
|
|
|
|
/usr/sbin/sendmail -t < log
|
|
|
|
fi
|
2004-04-11 12:31:25 -04:00
|
|
|
fi
|