Hudson之——Hudson的使用(使用 Hudson 来自动化编译、分析、打包、发布、部署项目)(转)
转载请注明出处:http://blog.csdn.net/l1028386804/article/details/71076592
添加项目
图1
图2
图3
图4
图5
图6
edu-common-parent为所有项目的父级项目,没有任务Java代码,如果项目中有Java代码,则与上述配置稍微有点区别,具体看下面的步骤。
图7
图8
图9
图10
图11
图12
图13
图14
图15
图16
附录:
service-user.sh代码如下:
- #!/bin/sh
- ## java env
- export JAVA_HOME=/usr/local/java/jdk1.7.0_72
- export JRE_HOME=$JAVA_HOME/jre
- ## service name
- APP_NAME=user
- SERVICE_DIR=/home/wusc/edu/service/$APP_NAME
- SERVICE_NAME=edu-service-$APP_NAME
- JAR_NAME=$SERVICE_NAME\.jar
- PID=$SERVICE_NAME\.pid
- cd $SERVICE_DIR
- case "$1" in
- start)
- nohup $JRE_HOME/bin/java -Xms256m -Xmx512m -jar $JAR_NAME >/dev/null 2>&1 &
- echo $! > $SERVICE_DIR/$PID
- echo "=== start $SERVICE_NAME"
- ;;
- stop)
- kill `cat $SERVICE_DIR/$PID`
- rm -rf $SERVICE_DIR/$PID
- echo "=== stop $SERVICE_NAME"
- sleep 5
- P_ID=`ps -ef | grep -w "$SERVICE_NAME" | grep -v "grep" | awk '{print $2}'`
- if [ "$P_ID" == "" ]; then
- echo "=== $SERVICE_NAME process not exists or stop success"
- else
- echo "=== $SERVICE_NAME process pid is:$P_ID"
- echo "=== begin kill $SERVICE_NAME process, pid is:$P_ID"
- kill -9 $P_ID
- fi
- ;;
- restart)
- $0 stop
- sleep 2
- $0 start
- echo "=== restart $SERVICE_NAME"
- ;;
- *)
- ## restart
- $0 stop
- sleep 2
- $0 start
- ;;
- esac
- exit 0
restart.sh代码如下:
- ## java env
- export JAVA_HOME=/usr/local/java/jdk1.7.0_72
- export JRE_HOME=$JAVA_HOME/jre
- ## restart tomcat
- /home/wusc/edu/web/boss-tomcat/bin/shutdown.sh
- sleep 3
- rm -rf /home/wusc/edu/web/boss-tomcat/webapps/edu-web-boss
- /home/wusc/edu/web/boss-tomcat/bin/startup.sh
感谢您的阅读,您的支持是我写博客动力。