ranger组件国际化及部署
# 国际化
# jsp老系统部署
参考:用脚手架快速部署前端项目
# 内部fish老系统部署
相比jsp项目,这个核心的就是要更新.jar中的文件;
jar uvf ZBDPWeb-5.0.jar META-INF/resources
:替换jar中对应目录下的文件;
优化前后端项目,通过脚手架只部署前端;大大提高部署效率;**从之前Jenkins构建前后端项目,10min压缩到20s内部完成;**部署效率提高20倍;
zdeploy.json
因serverHookCmd
不支持支持允许sudo 的.sh文件,要在服务器中单独执行 sudo sh restart.sh
用于服务器容器重启,再等10s 后才可以看到更新;
[
{
"type": "upload",
"name": "开发环境",
"host": "xxxx",
"port": "22",
"username": "xxx",
"password": "xxx",
"localCmd": "zip -r dist.zip ZBDPWeb/src/main/webapp/*",
"serverCmd": "cd /home/bdp/dm/ && mv dist/ dist-bak/",
"localScp": "dist.zip",
"serverScp": "/home/bdp/dm/dist.zip",
// "serverHookCmd": "cd /home/bdp/dm/ && rm -rf ZBDPWeb/ dist/ META-INF/ && unzip dist.zip && mkdir -p META-INF/resources && cp -R ZBDPWeb/src/main/webapp/* META-INF/resources && sudo sh start.sh stopAll && jar uvf ZBDPWeb-5.0.jar META-INF/resources && sudo sh start.sh startAll",
"serverHookCmd": "cd /home/bdp/dm/ && rm -rf ZBDPWeb/ dist/ META-INF/ && unzip dist.zip && mkdir -p META-INF/resources && cp -R ZBDPWeb/src/main/webapp/* META-INF/resources && jar uvf ZBDPWeb-5.0.jar META-INF/resources",
"localHookCmd": ""
},
{
"type": "download",
"name": "生产环境",
"host": "127.0.0.2",
"port": "2222",
"username": "deploy",
"password": "xxx",
"localCmd": "zip -r dist.zip dist/ && mv dist.zip dist-bak.zip",
"serverCmd": "cd /home/deploy/fe-deploy/ && zip -r dist.zip dist/",
"localScp": "./",
"serverScp": "/home/deploy/fe-deploy/dist.zip",
"serverHookCmd": "",
"localHookCmd": "unzip dist.zip"
}
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
后面要更新jar中以来的lib的jar功能;要再优化处理;暂时把前端合并在一块处理;
本地前置优化处理脚本:
{
"type": "upload",
"name": "开发环境",
"host": "10.45.46.x x x",
"port": "22",
"username": "xx",
"password": "xxx",
"localCmd": "rm -rf dist.zip dist && mkdir -p dist/META-INF/resources && cp -R ZBDPWeb/src/main/webapp/* dist/META-INF/resources && zip -r dist.zip dist/META-INF/resources/",
"serverCmd": "cd /home/bdp/dm/ && mv dist/ dist-bak/",
"localScp": "dist.zip",
"serverScp": "/home/bdp/dm/dist.zip",
"serverHookCmd": "cd /home/bdp/dm/ && rm -rf dist/ META-INF/ && unzip dist.zip && cp -R dist/* ./ && jar uvf ZBDPWeb-5.0.jar META-INF/resources ",
"localHookCmd": "sudo sh restart.sh"
},
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
上次更新: 2023/11/17, 05:08:18