本文共 2547 字,大约阅读时间需要 8 分钟。
Shell install Tool
tar zxvf apache-tomcat-6.0.37.tar.gz
mv apache-tomcat-6.0.37 /www/tomcat
tar zxvf jdk-7u25-linux-x64.gz
mv jdk1.7.0_25 /usr/local/java
tar zxvf apache-ant-1.8.1-bin.tar.gz
mv apache-ant-1.8.1 /usr/local/ant
# cat /etc/profile
ANT_HOME=/usr/local/ant
ANT_BIN=$ANT_HOME/bin
TOMCAT_HOME=/www/tomcat
TOMCAT_BIN=$TOMCAT_HOME/bin
JAVA_HOME=/usr/local/java
JAVA_BIN=$JAVA_HOME/bin
PATH=$PATH:$JAVA_BIN:$TOMCAT_BIN:$ANT_BIN
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH TOMCAT_HOME TOMCAT_BIN
# source /etc/profile
#Ant build.xml file
cat build.xml
<?xml version="1.0"?>
<project name="AutoComplie" default="compile" basedir="."><property name="libpath" value="/www/svnclient/******/WebContent/WEB-INF/lib"></property>
<property name="libpath" value="${web.home}/WEB-INF/lib"></property><path id="compile.classpath" description="设置classpath">
<pathelement location="${classpath}"/> <fileset dir="${libpath}"> <include name="*.jar"/> </fileset> </path><target name="StartCompile">
<!--新建网站目录tender--> <mkdir dir="tender"/> <!--复制WebContent目录下所有文件到tender下--> <copy todir="tender"> <fileset dir="WebContent"/> </copy> <!--删除build目录--> <delete dir="build"/> <!--创建目录build/classes并编译src到build/classes--> <mkdir dir="tender/WEB-INF/classes"/> <javac srcdir="src" destdir="tender/WEB-INF/classes"> <classpath refid="compile.classpath"></classpath> </javac><!--创建目录-->
<mkdir dir="tender/WEB-INF/classes/conf"/> <mkdir dir="tender/WEB-INF/classes/template"/> <!--COPY配置文件目录和临时文件目录--> <copy todir="tender/WEB-INF/classes/conf"> <fileset dir="src/conf"/> </copy> <copy todir="tender/WEB-INF/classes/template"> <fileset dir="src/template"/> </copy> <!--其它两个文件--> <copy file="src/struts.properties" tofile="tender/WEB-INF/classes/struts.properties"/> <copy file="src/struts.xml" tofile="tender/WEB-INF/classes/struts.xml"/><replace file ="tender/WEB-INF/classes/conf/jdbc.properties" token="jdbc.password=*******" value="jdbc.password=*******"/>
<replace file ="tender/WEB-INF/classes/conf/jdbc.properties" token="jdbc.username=*******" value="jdbc.username=*******"/> <!--移动到新目录--> <move todir="/www/tomcat/webapps/tender"> <fileset dir="tender"/> </move> </target></project>
cat OutWeb.sh#!/bin/bash
Build="/www/svnclient/*******"
Ant="/usr/local/ant/bin/ant"
Tomcat="/www/tomcat/bin/catalina.sh"
cd $Build
svn update
$Tomcat stop
kill -9 `/sbin/pidof java`
$Ant -f $Build/build.xml StartCompile
$Tomcat start
echo "Very Good"
更新:
1、用python flask web框架给开发提供简单的API。
2、测试环境的代码更新工作交给测试人员去做。
转载地址:https://blog.csdn.net/weixin_33961829/article/details/85101702 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!