巧用脚本发布静态资源

简介:

跳板机上的发布脚本:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
cat  copy_h5mall.sh 
#!/bin/sh
#只做SAAS  copy h5 mall
nginx_static_ip=10.10.80.22
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/static/all/h5_mall /data/static/all/h5_mall-${time_stamp}"
     ssh  ${nginx_static_ip}  "cd /data/static/all/h5_mall && /bin/rm -rf *"
     scp  .. /static/ ${h5_mall_zip_name} ${nginx_static_ip}: /data/static/all/h5_mall/
     ssh  ${nginx_static_ip}  "cd /data/static/all/h5_mall && unzip ${h5_mall_zip_name}"
fi
ip_list=` cat  .. /env .sh |  grep  "frontier-cms-web"  cut  -d  "="  -f1 |  cut  -d  "#"  -f2 |  uniq `
scp  .. /static/ ${h5_mall_zip_name} ${ip_list}: /tmp
sleep  5;
#调用frontier-cms-web 服务器上的另一个脚本
ssh  ${ip_list}  "cd /data/static && sh deploy_h5_mall.sh ${h5_mall_zip_name}"


#脚本拆开运行,frontier-cms-web 服务器地址:

1
2
cat  .. /env .sh |  grep  "frontier-cms-web"  cut  -d  "="  -f1 |  cut  -d  "#"  -f2 |  uniq
10.10.80.16



#frontier-cms-web服务器上的静态资源目录每个conmand Id目录都需要发布:

1
2
3
4
5
6
7
8
9
[vm10-10-80-16 static]$  ls
1  1002  1003  1006  1007  1008  11009  11010  11011  6  deploy_h5_mall.sh  deploy_pc_mall.sh
[ody@vm10-10-80-16 static]$  ls  1002 1003
1002:
h5_mall      h5_mall1108  h5_mall12071548  h5_mall.bak  pc_mall1110  pc_mall1116  pc_mall12062009  pc_mall12211923
h5_mall1107  h5_mall1207  h5_mall1221      pc_mall      pc_mall1115  pc_mall1130  pc_mall1207
1003:
h5_mall      h5_mall1108      h5_mall1207  pc_mall      pc_mall1130  pc_mall1207
h5_mall1107  h5_mall11301833  h5_mall1221  pc_mall1110  pc_mall1206  pc_mall12211923


#frontier-cms-web 服务器上之前写的一个的发布脚本,不够自动化还需要登录这台机器运行:

1
2
3
4
5
6
7
8
9
10
11
[vm10-10-80-16 static]$  cat  deploy_h5_mall.sh 
#!/bin/sh
war=$1
Time=` date  "+%Y-%m-%d-%H-%M" `
for  dir  in  ` ls  /data/static  egrep  - v  deploy_ "(pc|h5)" _mall.sh`; do
     echo  ${ dir }
     cd  /data/static/ ${ dir } &&  cp  -r h5_mall h5_mall_ "${Time}"
     cd  /data/static/ ${ dir } /h5_mall/  &&  rm  -rf *
     cp  /tmp/ ${war}  /data/static/ ${ dir } /h5_mall/
     cd  /data/static/ ${ dir } /h5_mall  && unzip  "${war}"
done


本文转自青衫解衣 51CTO博客,原文链接:http://blog.51cto.com/215687833/1900877


相关文章
|
7天前
|
人工智能 运维 安全
|
5天前
|
人工智能 异构计算
敬请锁定《C位面对面》,洞察通用计算如何在AI时代持续赋能企业创新,助力业务发展!
敬请锁定《C位面对面》,洞察通用计算如何在AI时代持续赋能企业创新,助力业务发展!
|
6天前
|
机器学习/深度学习 人工智能 自然语言处理
B站开源IndexTTS2,用极致表现力颠覆听觉体验
在语音合成技术不断演进的背景下,早期版本的IndexTTS虽然在多场景应用中展现出良好的表现,但在情感表达的细腻度与时长控制的精准性方面仍存在提升空间。为了解决这些问题,并进一步推动零样本语音合成在实际场景中的落地能力,B站语音团队对模型架构与训练策略进行了深度优化,推出了全新一代语音合成模型——IndexTTS2 。
604 21
|
12天前
|
人工智能 JavaScript 测试技术
Qwen3-Coder入门教程|10分钟搞定安装配置
Qwen3-Coder 挑战赛简介:无论你是编程小白还是办公达人,都能通过本教程快速上手 Qwen-Code CLI,利用 AI 轻松实现代码编写、文档处理等任务。内容涵盖 API 配置、CLI 安装及多种实用案例,助你提升效率,体验智能编码的乐趣。
969 110
|
6天前
|
人工智能 测试技术 API
智能体(AI Agent)搭建全攻略:从概念到实践的终极指南
在人工智能浪潮中,智能体(AI Agent)正成为变革性技术。它们具备自主决策、环境感知、任务执行等能力,广泛应用于日常任务与商业流程。本文详解智能体概念、架构及七步搭建指南,助你打造专属智能体,迎接智能自动化新时代。