gitgrab.sh
为什么80%的码农都做不了架构师?>>>
#!/bin/bash | |
# Pulls changes from github and copies them to the appropriate tomcat container | |
# Henry Olson, 2014 | |
changes=0 | |
#app names and classes go in this key->value associative array | |
declare -A aa | |
aa["FirstApp"]="formServlet" | |
aa["HelloApp"]="helloServlet" | |
#loop through associative array | |
for n in "${!aa[@]}" | |
do | |
cd /Documents/$n | |
#only update if there is something to grab | |
git fetch origin | |
x=$(git diff master origin/master) | |
if [ -z "$x" ] | |
then | |
continue | |
fi | |
#pull changes and copy to tomcat directory | |
git pull https://github.com/holson1/$n.git master | |
cp -u ${aa[$n]}.class /opt/apache-tomcat-7.0.47/webapps/$n/WEB-INF/classes/ | |
#if we made it here, there have been changes warranting a restart | |
changes=1 | |
done | |
#restart tomcat to see changes | |
if [ $changes -eq 1 ] | |
then | |
service tomcat restart | |
fi |
转载于:https://my.oschina.net/liting/blog/530405
gitgrab.sh相关推荐
- 浅显易懂 Makefile 入门 (08)— 默认 shell (/bin/sh)、命令回显、make参数(-n 只显示命令但不执行,-s 禁止所有回显)、单行命令、多行命令、并发执行
1. shell 相关 1.1 默认 shell Makefile 所使用的命令是由 shell 命令行组成,他们是一条一条执行的. 多个命令之间要使用分号隔开,Makefile 中的任何命令都要以 ...
- linux启动,重启,停止 jar,.sh脚本
linux启动,重启,停止 jar,.sh脚本 #配置jar名称 APP_NAME=receiver.jar#使用说明,用来提示输入参数 usage() { echo "Usage: sh ...
- sh计算机,计算机教程:shellII(sh).pdf
下载 第10章 shell II (sh) Bourne shell (s h ).C shell (c s h )以及Korn shell (k s h )是命令解释程序及高级编程语言. 作为命令解 ...
- ecos 编译时无法找到 tclConfig.sh 和 tkConfig.sh
这是因为 tcl-devel tk-devel 一般系统中默认是不安装的,至少cent-os 5.5 和fedora 11是这样的,安装这两个包即可. # yum install tcl-devel ...
- shell与 .sh文件与 .bash文件
一.shell和bash shell是LInux系统下的解释器,类似于windows下的cmd.shell对用户输入到窗口中的命令行进行解释,输入到内核. bash同样是Linux系统下的解释器,是b ...
- linux sh for ls,Linux shell for while 循环
1.数字段形式 for i in {1..10} do echo $i done 2.详细列出(字符且项数不多) for File in 1 2 3 4 5 do echo $File done 3. ...
- linux重启sh脚本,Linux 之shell脚本系列之服务启动/关闭/重启/状态
一 问题 自己开发的程序,如何用shell 脚本实现 启动,关闭,重启,查看状态? 二 方案 myshell.sh #!/bin/sh SERVICE="fm_tuoguan_shell&q ...
- upgrade lnmpa php.sh,LNMP 状态管理命令说明及Nginx、MySQL/MariaDB、PHP升级教程
状态管理命令分 LNmp状态管理命令 和 LNmpA状态管理命令,LNMPA代表的是Linux下Nginx.MySQL.PHP.Apache这种网站服务器架构,是结合LAMP与LNMP各自的优点而产生 ...
- 下怎么运行sh脚本_基于CentOS7系统添加自定义脚本服务及参数说明,附实例
概述 centos6如果要添加自定义脚本服务只需要把脚本放到/etc/init.d然后授权后用chkconfig添加后就可以管理了,那么centos7又是怎么添加自定义脚本服务呢? CentOS7添加 ...
- lispbox 安装运行.sh的时候出现 lispbox.sh: 2: lispbox.sh: Bad substitution
安装lispbox时使用tar命令将压缩文件解压之后cd进入之后在运行.sh文件时出现了如下情况. $ sh lispbox.sh lispbox.sh: 2: lispbox.sh: Bad sub ...
最新文章
- Python的零基础超详细讲解(第五天)-Python的运算符
- Thinkpad T420 指纹开机 win10 解决方案
- leetcode算法题--求1+2+…+n
- spring cloud微服务分布式云架构 - 整合企业架构的技术点
- 最长公共子序列(稀疏序列)nlogn解法
- jdbc mysql分页_JDBC【数据库连接池、DbUtils框架、分页】
- Ubuntu 16.04 中 安装 Docker
- centos下python中添加easygui模块
- PHP 实现定时任务的几种方法
- qq浏览器主页_讨论|360、金山毒霸、浏览器主页劫持
- 樊登高效休息法心得400字_从3个方面入手,让运营工作更高效!
- android studio按键精灵,51模拟器怎么连接按键精灵 51安卓模拟器按键精灵连接教程...
- 解读 JVM 类加载器-一篇文章简单易懂
- 云计算5G的基本概念
- SSIM(结构相似性)-数学公式及python实现
- Linux创建shell脚本文件
- 电力大数据存在的问题和解决方案
- 深度学习中的感受野计算
- 我终于解救了系统盘ORZ
- JavaEclipse中从Lambada表达式运行错误的解决方法到学到新知识