File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed
Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 1010 pull_request :
1111 branches :
1212 - next
13+ - refactor/dev
1314 push :
1415 branches :
1516 - next
17+ - refactor/dev
1618
1719 # 手动触发部署
1820 workflow_dispatch :
Original file line number Diff line number Diff line change 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+ ```
Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments