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
|
|
|
|
#
|
|
|
|
# 3. export MAVEN_HOME=~/maven
|
2004-04-09 10:11:57 -04:00
|
|
|
#
|
2004-04-10 14:29:46 -04:00
|
|
|
# 4. export PATH=$PATH:$MBOOT:$MAVEN_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
|
|
|
|
export MAVEN_HOME=$HOME/maven
|
2004-04-09 20:57:25 -04:00
|
|
|
export PATH=$PATH:$MBOOT_HOME:$MAVEN_HOME/bin:$JAVA_HOME/bin
|
2004-04-09 19:56:23 -04:00
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
|
2004-04-10 14:29:46 -04:00
|
|
|
CMD=$1
|
|
|
|
|
|
|
|
[ "$1" = "" ] && echo && echo "You must specify a checkout or update!" && echo && exit
|
|
|
|
|
2004-04-10 15:19:09 -04:00
|
|
|
DIR=m2
|
2004-04-09 00:27:28 -04:00
|
|
|
REPO=maven-repo-local
|
2004-04-09 10:11:57 -04:00
|
|
|
FROM=jvanzyl@maven.org
|
|
|
|
TO=maven2-user@lists.codehaus.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-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
|
|
|
# ----------------------------------------------------------------------------------
|
|
|
|
|
2004-04-10 14:29:46 -04:00
|
|
|
HOME_DIR=`pwd`
|
2004-04-09 00:27:28 -04:00
|
|
|
DATE=`date`
|
2004-04-09 10:11:57 -04:00
|
|
|
echo "From: $FROM" > log
|
|
|
|
echo "To: $TO" >> log
|
2004-04-09 00:27:28 -04:00
|
|
|
echo "Subject: Maven bootstrap on beaver [$DATE]" >> log
|
|
|
|
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
|
|
|
|
|
|
|
|
./bootstrap-all.sh
|
2004-04-10 15:19:09 -04:00
|
|
|
)
|
2004-04-10 18:04:27 -04:00
|
|
|
|
|
|
|
echo
|
2004-04-10 15:24:38 -04:00
|
|
|
echo "Creating m2 distribution for public consumption ... "
|
2004-04-10 18:04:27 -04:00
|
|
|
echo
|
2004-04-10 15:24:38 -04:00
|
|
|
|
|
|
|
(
|
|
|
|
cd $DIR/maven-components/maven-core/dist
|
|
|
|
|
|
|
|
tar czf m2-${TIMESTAMP}.tar.gz m2
|
|
|
|
|
|
|
|
cp m2-${TIMESTAMP}.tar.gz $HOME_DIR
|
|
|
|
)
|
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-10 15:02:57 -04:00
|
|
|
/usr/sbin/sendmail -t < log
|