赞
踩
参考上一期《jenkins自动部署-GitHub》安装教程,实现Jenkins与Gitee的自动化部署。
Jenkins管理 => 系统配置
#!/bin/bash source /etc/profile chmod 755 /app/gitee/jenkins-gitee.jar count=`ps -ef|grep java|grep jenkins-gitee.jar |awk '{print $2}'` if [ $count -gt 0 ]; then echo '原进程:'$count echo '重新启动中...' kill -9 $count sleep 1 export BUILD_ID=dontKillMe (java -jar /app/gitee/jenkins-gitee.jar > /app/gitee/log/log.log 2>&1 &) else echo '启动中...' sleep 1 export BUILD_ID=dontKillMe (java -jar /app/gitee/jenkins-gitee.jar > /app/gitee/log/log.log 2>&1 &) fi echo '现进程:' `ps -ef|grep java|grep jenkins-gitee.jar |awk '{print $2}'`
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。