#!/bin/bash
DIR_BASE=/home/developers/tony/
SVN_BASE=http://svn.designreactor.com/repos/CISCO_CEO/Cisco_CEO/tags
if [ "$#" != 1 ]
then
echo "Parameters error. 1 parameter is needed."
echo "Usage: deploy_stage.sh SVN_URL"
else
SVN_URL=$SVN_BASE/$1
DIR_PATH=$DIR_BASE/$1
echo $SVN_URL
svn export "$SVN_URL" "$DIR_PATH"
cd "$DIR_PATH"
ant -f build_stage.xml
fi
At first, I use PATH, system point out svn: command not found, and actually PATH is PATH of environment, so I use DIR_PATH instead of PATH, it works very well now!