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 10
10
pull_request :
11
11
branches :
12
12
- next
13
+ - refactor/dev
13
14
push :
14
15
branches :
15
16
- next
17
+ - refactor/dev
16
18
17
19
# 手动触发部署
18
20
workflow_dispatch :
Original file line number Diff line number Diff line change
1
+ # deploy脚本备份
2
+
3
+ ``` js
1
4
#! / usr/ bin/ env node
2
5
/**
3
6
*
@@ -31,8 +34,8 @@ const SupportScripts = {
31
34
cd -
32
35
` ,
33
36
Ali: [
34
- // 容器存在即删除
35
- `
37
+ // 容器存在即删除
38
+ `
36
39
if docker inspect --format='{{.State.Running}}' ${ dockerDeployInfo .containerName } >/dev/null 2>&1;then
37
40
docker rm -f ${ dockerDeployInfo .containerName }
38
41
exit 0;
@@ -41,8 +44,8 @@ const SupportScripts = {
41
44
exit 1;
42
45
fi
43
46
` ,
44
- // 镜像存在即删除
45
- `
47
+ // 镜像存在即删除
48
+ `
46
49
if [ "$(docker images -q ${ imageName} 2> /dev/null)" != "" ];then
47
50
docker rmi ${ imageName}
48
51
exit 0;
@@ -51,8 +54,8 @@ const SupportScripts = {
51
54
exit 1;
52
55
fi
53
56
` ,
54
- // 运行容器
55
- `
57
+ // 运行容器
58
+ `
56
59
docker run -d --name ${ dockerDeployInfo .containerName } \
57
60
-p 7100:80 \
58
61
--network=${ dockerDeployInfo .networkName } \
@@ -87,3 +90,5 @@ function getDeployCommand() {
87
90
// console.log(deployCommand)
88
91
await execShell (deployCommand)
89
92
})()
93
+
94
+ ```
Original file line number Diff line number Diff line change
1
+
2
+ # Docker脚本备份
3
+
4
+
5
+ ``` js
1
6
#! / usr/ bin/ env node
2
7
3
8
/**
@@ -80,7 +85,7 @@ const SupportScriptsInNetWork = {
80
85
`
81
86
],
82
87
inspect:
83
- `
88
+ `
84
89
docker network inspect ${ dockerNetworkInfo .defaultName }
85
90
`
86
91
}
@@ -176,3 +181,4 @@ function getCommand() {
176
181
const command = getCommand (scriptName)
177
182
await execShell (command)
178
183
})()
184
+ ```
You can’t perform that action at this time.
0 commit comments