Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nuxt-backend-helper
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王曜嵚 Wang Yaoqin
nuxt-backend-helper
Commits
9446dc52
Commit
9446dc52
authored
May 09, 2024
by
王曜嵚 Wang Yaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev: 状态
parent
289f8281
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
10 deletions
+6
-10
execute.post.ts
server/api/devops/v1/execute.post.ts
+0
-4
execute.post.ts
server/api/devops/v2/execute.post.ts
+0
-4
docker.ts
server/utils/docker.ts
+6
-2
No files found.
server/api/devops/v1/execute.post.ts
View file @
9446dc52
...
@@ -11,10 +11,6 @@ export default defineEventHandler(async (event) => {
...
@@ -11,10 +11,6 @@ export default defineEventHandler(async (event) => {
LogUtil
.
printInfo
(
username
,
'程序启动中'
)
LogUtil
.
printInfo
(
username
,
'程序启动中'
)
await
changeProjectStatus
(
'v1'
,
username
,
'status'
,
'running'
)
await
changeProjectStatus
(
'v1'
,
username
,
'status'
,
'running'
)
const
rowV2
=
await
getPgTableData
(
'v2'
,
username
)
if
(
rowV2
?.
status
===
'launched'
)
{
await
changeProjectStatus
(
'v2'
,
username
,
'status'
,
'compiled'
)
}
if
(
!
container
)
{
if
(
!
container
)
{
throw
new
Error
(
'没有创建容器,请先初始化容器'
)
throw
new
Error
(
'没有创建容器,请先初始化容器'
)
}
}
...
...
server/api/devops/v2/execute.post.ts
View file @
9446dc52
...
@@ -14,10 +14,6 @@ export default defineEventHandler(async (event) => {
...
@@ -14,10 +14,6 @@ export default defineEventHandler(async (event) => {
LogUtil
.
printInfo
(
username
,
`程序初始化中......`
)
LogUtil
.
printInfo
(
username
,
`程序初始化中......`
)
await
changeProjectStatus
(
'v2'
,
username
,
'status'
,
'running'
)
await
changeProjectStatus
(
'v2'
,
username
,
'status'
,
'running'
)
const
rowV1
=
await
getPgTableData
(
'v1'
,
username
)
if
(
rowV1
?.
status
===
'launched'
)
{
await
changeProjectStatus
(
'v2'
,
username
,
'status'
,
'compiled'
)
}
if
(
!
container
)
{
if
(
!
container
)
{
throw
new
Error
(
'没有创建容器,请先初始化容器'
)
throw
new
Error
(
'没有创建容器,请先初始化容器'
)
}
}
...
...
server/utils/docker.ts
View file @
9446dc52
...
@@ -170,11 +170,15 @@ class Docker {
...
@@ -170,11 +170,15 @@ class Docker {
if
(
platform
===
'v1'
)
{
if
(
platform
===
'v1'
)
{
await
this
.
switchJavaVersion
({
container
,
username
,
version
:
8
})
await
this
.
switchJavaVersion
({
container
,
username
,
version
:
8
})
const
statusV2
=
(
await
getPgTableData
(
'v2'
,
username
))?.
status
const
statusV2
=
(
await
getPgTableData
(
'v2'
,
username
))?.
status
if
(
statusV2
)
changeProjectStatus
(
'v2'
,
username
,
'status'
,
'compiled'
)
// 如果系统在运行,回退到已创建的状态
if
(
statusV2
===
'launched'
||
statusV2
===
'debug-launched'
)
{
await
changeProjectStatus
(
'v2'
,
username
,
'status'
,
'compiled'
)
// 如果系统在运行,回退到已创建的状态
}
}
else
{
}
else
{
await
this
.
switchJavaVersion
({
container
,
username
,
version
:
17
})
await
this
.
switchJavaVersion
({
container
,
username
,
version
:
17
})
const
statusV1
=
(
await
getPgTableData
(
'v1'
,
username
))?.
status
const
statusV1
=
(
await
getPgTableData
(
'v1'
,
username
))?.
status
if
(
statusV1
)
changeProjectStatus
(
'v1'
,
username
,
'status'
,
'compiled'
)
// 如果系统在运行,回退到已创建的状态
if
(
statusV1
===
'launched'
)
{
await
changeProjectStatus
(
'v1'
,
username
,
'status'
,
'compiled'
)
// 如果系统在运行,回退到已创建的状态
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment