Commit 5b6ed740 authored by Vincent Pelletier's avatar Vincent Pelletier

Tested and improved.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5492 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6eb3a3a3
#!/bin/bash #!/bin/bash
# Where we want to store the source code from cvs # TODO: BT5 version support (stable/unstable)
CVS_PATH="/home/$USER/cvs"
REPOSIT="cvs.erp5.org" # Lock file name
LOCKFILE="/tmp/$0.lock"
# Retrieve the version of the source code as anonymous user to be sure we get published code only # CVS root
cd $CVS_PATH && cvs -d:pserver:anonymous@$REPOSIT:/cvsroot checkout erp5_bt CVSROOT=":pserver:anonymous@cvs.erp5.org:/cvsroot"
mkdir $CVS_PATH/bt5 # Module containing business template
MODULE="erp5_bt5"
# Remove CVS extra files # Script generating the business template repository index (in $REPOSITORY)
find $CVS_PATH/erp5_bt/* -name "CVS" | xargs rm -rf GENBTLIST="ERP5/bin/genbt5list" # XXX: relative to the same repository
# Local directory to receive CVS copy
# Get the list of Business Template BASELOCALDIR="/tmp"
# BT5_LIST is the list of folder found in $CVS_PATH/erp5_bt # Local directory to receive butiness templates
BT5_LIST=`ls $CVS_PATH/erp5_bt` BT5DIR="/var/lib/zope/static/reposit/erp5/upload_module"
function cleanup () {
rm -f $LOCKFILE
exit 1
}
if [ -e "$LOCKFILE" ]; then
echo "Lock file '$LOCKFILE' exists, exiting..."
exit 1
fi
touch "$LOCKFILE" || exit 1
LOCALDIR="$BASELOCALDIR/$$"
mkdir "$LOCALDIR" || cleanup
# Checkout the source code from cvs
cd "$LOCALDIR" || cleanup
cvs -Qz3 "-d$CVSROOT" checkout "$MODULE" || cleanup
# Create one archive for each Business Template # Create one archive for each Business Template
cd $CVS_PATH/erp5_bt for BT5 in `ls "$LOCALDIR/$MODULE"`; do
for $BT5 in $BT5_LIST if [ "$BT5" != "CVS" -a -d "$LOCALDIR/$MODULE/$BT5" ]; then
do echo "Building $BT5..."
cd $CVS_PATH/erp5_bt cd "$LOCALDIR/$MODULE/$BT5" || cleanup
tar zcvf $BT5.tgz $BT5 tar -zcf "$LOCALDIR/$BT5.bt5" --exclude CVS --exclude .cvsignore . || cleanup
mv $CVS_PATH/erp5_bt/$BT5.tgz $CVS_PATH/bt5/$BT5.bt5 else
done echo "Skipping $BT5"
fi
# Get the latest version of the genbt5list (the script that generate the index) done
cd $CVS_PATH/bt5
cvs -d:pserver:anonymous@$REPOSIT:/cvsroot checkout ERP5/bin/genbt5list # Get the latest version of the genbt5list and generate the index
cd "$LOCALDIR" || cleanup
# Generate the repository index cvs -Qz3 "-d$CVSROOT" checkout "$GENBTLIST" || cleanup
python $CVS_PATH/bt5/genbt5list python "$GENBTLIST" || cleanup
rm -f genbt5list
# Publish the repository # Publish the repository
mv -f $CVS_PATH/bt5/* /var/www/erp5.org/bt5/ mv -f bt5list "$LOCALDIR/"*.bt5 "$BT5DIR"
# Clean up # Clean up
rm -rf $CVS_PATH/* rm -rf $LOCALDIR
\ No newline at end of file rm -f $LOCKFILE
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment