网站做微信支付宝支付,怎么样可以做自己的网站,wordpress修改网址,苏州公司建站自动化更新包文件--shell脚本 背景手动更包自动化更包 背景
作为一名实施工程师#xff0c;当然也协助做些测试的工作#xff0c;当产品功能开发后#xff0c;研发会将本次迭代涉及的前后端包文件提供过来。有时会因为一些原因研发没法现场开发#xff0c;那就需要我们配合… 自动化更新包文件--shell脚本 背景手动更包自动化更包 背景
作为一名实施工程师当然也协助做些测试的工作当产品功能开发后研发会将本次迭代涉及的前后端包文件提供过来。有时会因为一些原因研发没法现场开发那就需要我们配合测试并将情况反馈给研发会频繁的更新包文件。手动更包除了麻烦效率也低所以建议自动化脚本更包其实也就是把手动命令写到一个shell脚本中直接执行。 有些客户环境有自动化运维应用直接把脚本内容复制粘贴运行即可同理。
手动更包 前端包operation 涉及到前端定制化页面展示除了必要js文件保留不变其他均采用本次operation包。 后端包diagram.jar 更新整个diagram.jar包或者在原jar包基础上更新部分class文件。 连接服务器 从某服务器获取更新包或把文件包传到某服务器以便更包。 手动更包代码片.
// 备份原包放到bak下
mkdir -p /2024/20240328/bak
mv /test/webapp/operation /2024/20240328/bak
// 部署新包放到指定文件夹下
cd /2024/20240328
sftp -o port1234 engineer1.2.3.4
// 此处需要输入密码Engineer123
cd /test/engineer
get operation.zip
exit
// 然后对新包处理
unzip operation.zip
mv operation /test/webapp/operation
// 替换部分文件
cp /2024/20240328/bak/operation/static/domain.js /test/webapp/operation/static/自动化更包
touch update.sh vi update.sh
更包代码片.
#!/usr/bin/sh
// 备份原包放到bak下
mkdir -p /2024/20240328/bak
mv /test/webapp/operation /2024/20240328/bak
// 部署新包放到指定文件夹下
cd /2024/20240328
curl -u engineer:Engineer123 -O sftp://1.2.3.4:1234/test/engineer/operation.zip
unzip operation.zip
mv operation /test/webapp/operation
// 替换部分文件
cp /2024/20240328/bak/operation/static/domain.js /test/webapp/operation/static/
update_time$(date %Y-%m-%d %H:%M:%S)#
current_date$(date %Y-%m-%d)#
current_time$(date %H:%M:%S)#
echo 更新时间:$update_time#
echo 当前日期:$current_date#
echo 当前时间:$current_time#sh update.sh 完成