上線須要發佈2個地方:nginx
一、nginx_static 1臺web
二、frontier-cms-web 3臺bash
和線上的服務器是經過跳板機通訊的。服務器
env文件是環境部署文件,格式爲#ip=war;ssh
cat copy_h5_mall_new.sh #!/bin/sh #copy h5 mall nginx_static_ip=10.10.13.37 time_stamp=`date +"%Y-%m-%d-%H-%M-%S"` h5_mall_zip_name=$1 war_md5=`md5sum ../static/${h5_mall_zip_name} | awk '{print $1}'` md5_file=`cat ../static/${h5_mall_zip_name}.md5 | awk '{print $1}'` if [ "${war_md5}" = "${md5_file}" ];then ssh ${nginx_static_ip} "cp -r /data/desheng/h5_mall /data/desheng/h5_mall-${time_stamp}" ssh ${nginx_static_ip} "cd /data/desheng/h5_mall && /bin/rm -rf *" scp ../static/${h5_mall_zip_name} ${nginx_static_ip}:/data/desheng/h5_mall ssh ${nginx_static_ip} "cd /data/desheng/h5_mall && unzip ${h5_mall_zip_name}" ip_list=`cat ../env.sh | grep "frontier-cms-web" | cut -d "=" -f1 | cut -d "#" -f2 | uniq` for ip in ${ip_list[*]};do scp ../static/${h5_mall_zip_name} $ip:/data/ ssh $ip "cd /data/static/10 && cp -r h5_mall h5_mall-${time_stamp}" ssh $ip "cd /data/static/10/h5_mall && /bin/rm -rf *" ssh $ip "mv /data/${h5_mall_zip_name} /data/static/10/h5_mall;cd /data/static/10/h5_mall && unzip ${h5_mall_zip_name}" done fi