简述:
包含基本的svn,check out 之后的ant打包脚本
test.shell
profile=$1
tag=$2
dest=$3
svnDir=/opt/applications/svndir-webproj
if [ ! -d $svnDir ];
then
echo 'Create svn check out folder'
mkdir $svnDir
echo 'Get source from SVN'
if [ ! $tag ] ; then
svn checkout https://192.168.1.199/svn/WebProj/trunk $svnDir/
else
svn checkout https://192.168.1.199/svn/WebProj/tags/$tag $svnDir/
fi
svn info > $svnDir/svn.info
fi
echo 'Switch SVN'
if [ ! $tag ] ; then
cd $svnDir
svn sw https://192.168.1.199/svn/WebProj/trunk $svnDir/
svn up
else
svn sw https://192.168.1.199/svn/WebProj/tags/$tag $svnDir/
fi
svn info > $svnDir/svn.info
echo 'War Output Destination'
cd $svnDir
if [ ! $dest ] ; then
ant -Dversion=$profile -Ddest=/opt/applications
else
ant -Dversion=$profile -Ddest=$dest
fi