Skip to content

Commit 2cdc560

Browse files
committed
feat: 删除deploy和docker脚本,备份对应逻辑
1 parent 164e34e commit 2cdc560

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

.github/workflows/CI.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ on:
1010
pull_request:
1111
branches:
1212
- next
13+
- refactor/dev
1314
push:
1415
branches:
1516
- next
17+
- refactor/dev
1618

1719
# 手动触发部署
1820
workflow_dispatch:

scripts/deploy renamed to docs/deploy-backup.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# deploy脚本备份
2+
3+
```js
14
#!/usr/bin/env node
25
/**
36
*
@@ -31,8 +34,8 @@ const SupportScripts = {
3134
cd -
3235
`,
3336
Ali: [
34-
// 容器存在即删除
35-
`
37+
// 容器存在即删除
38+
`
3639
if docker inspect --format='{{.State.Running}}' ${dockerDeployInfo.containerName} >/dev/null 2>&1;then
3740
docker rm -f ${dockerDeployInfo.containerName}
3841
exit 0;
@@ -41,8 +44,8 @@ const SupportScripts = {
4144
exit 1;
4245
fi
4346
`,
44-
// 镜像存在即删除
45-
`
47+
// 镜像存在即删除
48+
`
4649
if [ "$(docker images -q ${imageName} 2> /dev/null)" != "" ];then
4750
docker rmi ${imageName}
4851
exit 0;
@@ -51,8 +54,8 @@ const SupportScripts = {
5154
exit 1;
5255
fi
5356
`,
54-
// 运行容器
55-
`
57+
// 运行容器
58+
`
5659
docker run -d --name ${dockerDeployInfo.containerName} \
5760
-p 7100:80 \
5861
--network=${dockerDeployInfo.networkName} \
@@ -87,3 +90,5 @@ function getDeployCommand() {
8790
// console.log(deployCommand)
8891
await execShell(deployCommand)
8992
})()
93+
94+
```

scripts/docker renamed to docs/microservice/docker-backup.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2+
# Docker脚本备份
3+
4+
5+
```js
16
#!/usr/bin/env node
27

38
/**
@@ -80,7 +85,7 @@ const SupportScriptsInNetWork = {
8085
`
8186
],
8287
inspect:
83-
`
88+
`
8489
docker network inspect ${dockerNetworkInfo.defaultName}
8590
`
8691
}
@@ -176,3 +181,4 @@ function getCommand() {
176181
const command = getCommand(scriptName)
177182
await execShell(command)
178183
})()
184+
```

0 commit comments

Comments
 (0)