注意linux下面的命令行,要将PATH声明出来

export PATH=/apps/svr/maven/bin:/apps/svr/jdk7/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/apps/svr/phantomjs/bin:/root/bin:/srv/tools:/root/bin
export INPUTRC=/etc/inputrc
export PWD=/apps/dat/yourProjectName
export JAVA_HOME=/apps/svr/jdk7
export LANG=zh_CN.UTF-8
export SHLVL=1
export CLASSPATH=:/apps/svr/jdk7/lib/tools.jar:/apps/svr/jdk7/lib/dt.jar
mvn -version
cd /apps/dat/yourProjectName/
git pull
mvn clean
mvn install
cd /apps/svr/tomcat7/webapps/
cp /apps/svr/tomcat7/webapps/yourProjectName.war /apps/tomcat_bak/yourProjectName$(date +%Y%m%d-%H%M%S).war
rm -rf yourProjectName yourProjectName.war
scp /apps/dat/yourProjectName/target/yourProjectName.war .

你可能感兴趣的:(linux)