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
be14b492
Commit
be14b492
authored
Oct 21, 2024
by
王曜嵚 Wang Yaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev: 在运行时处理配置文件
parent
3b7858a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
5 deletions
+4
-5
compile.post.ts
server/api/devops/v1/compile.post.ts
+0
-1
execute.post.ts
server/api/devops/v1/execute.post.ts
+1
-0
compile.post.ts
server/api/devops/v2/compile.post.ts
+0
-4
execute.post.ts
server/api/devops/v2/execute.post.ts
+3
-0
No files found.
server/api/devops/v1/compile.post.ts
View file @
be14b492
...
@@ -43,7 +43,6 @@ export default defineEventHandler(async (event) => {
...
@@ -43,7 +43,6 @@ export default defineEventHandler(async (event) => {
try
{
try
{
await
docker
.
execContainerCommand
({
container
,
cmd
:
'mv -f ../../tenants_config ./projects'
,
dir
:
'/var/logwire-platform/dist'
})
await
docker
.
execContainerCommand
({
container
,
cmd
:
'mv -f ../../tenants_config ./projects'
,
dir
:
'/var/logwire-platform/dist'
})
}
catch
(
err
)
{}
}
catch
(
err
)
{}
await
copyAndCreateServerPropertiesV1InDocker
(
username
)
LogUtil
.
printInfo
(
username
,
'编译完成'
)
LogUtil
.
printInfo
(
username
,
'编译完成'
)
await
changeProjectStatus
(
'v1'
,
username
,
'status'
,
'compiled'
)
await
changeProjectStatus
(
'v1'
,
username
,
'status'
,
'compiled'
)
}
catch
(
err
)
{
}
catch
(
err
)
{
...
...
server/api/devops/v1/execute.post.ts
View file @
be14b492
...
@@ -15,6 +15,7 @@ export default defineEventHandler(async (event) => {
...
@@ -15,6 +15,7 @@ export default defineEventHandler(async (event) => {
throw
new
Error
(
'没有创建容器,请先初始化容器'
)
throw
new
Error
(
'没有创建容器,请先初始化容器'
)
}
}
await
copyAndCreateServerPropertiesV1InDocker
(
username
)
// 读取 pom.xml
// 读取 pom.xml
const
pomVersionStr
=
await
docker
.
getFile
({
container
,
path
:
'/var/logwire-platform/logwire-build/logwire-version/pom.xml'
})
const
pomVersionStr
=
await
docker
.
getFile
({
container
,
path
:
'/var/logwire-platform/logwire-build/logwire-version/pom.xml'
})
const
version
=
/<logwire-starter
\.
version>
(
.*
?)
<
\/
logwire-starter
\.
version>/
.
exec
(
pomVersionStr
)?.[
1
]
const
version
=
/<logwire-starter
\.
version>
(
.*
?)
<
\/
logwire-starter
\.
version>/
.
exec
(
pomVersionStr
)?.[
1
]
...
...
server/api/devops/v2/compile.post.ts
View file @
be14b492
import
LogUtil
from
"~/server/utils/log"
import
LogUtil
from
"~/server/utils/log"
import
{
copyAndCreateGatewayPropertiesV2InDocker
,
copyAndCreateServerPropertiesV2InDocker
}
from
"~/server/utils/server"
export
default
defineEventHandler
(
async
(
event
)
=>
{
export
default
defineEventHandler
(
async
(
event
)
=>
{
let
username
=
event
.
context
.
username
let
username
=
event
.
context
.
username
...
@@ -38,9 +37,6 @@ export default defineEventHandler(async (event) => {
...
@@ -38,9 +37,6 @@ export default defineEventHandler(async (event) => {
}
catch
(
err
)
{
}
catch
(
err
)
{
}
}
copyAndCreateServerPropertiesV2InDocker
(
username
)
copyAndCreateGatewayPropertiesV2InDocker
(
username
)
LogUtil
.
print
(
username
,
`[progress] [[1;34mInfo[m] 编译完成 \n`
)
LogUtil
.
print
(
username
,
`[progress] [[1;34mInfo[m] 编译完成 \n`
)
await
changeProjectStatus
(
'v2'
,
username
,
'status'
,
'compiled'
)
await
changeProjectStatus
(
'v2'
,
username
,
'status'
,
'compiled'
)
}
catch
(
err
)
{
}
catch
(
err
)
{
...
...
server/api/devops/v2/execute.post.ts
View file @
be14b492
...
@@ -18,6 +18,9 @@ export default defineEventHandler(async (event) => {
...
@@ -18,6 +18,9 @@ export default defineEventHandler(async (event) => {
throw
new
Error
(
'没有创建容器,请先初始化容器'
)
throw
new
Error
(
'没有创建容器,请先初始化容器'
)
}
}
await
copyAndCreateServerPropertiesV2InDocker
(
username
)
await
copyAndCreateGatewayPropertiesV2InDocker
(
username
)
// 有可能本身就关闭了
// 有可能本身就关闭了
try
{
try
{
await
docker
.
execContainerCommand
({
container
,
cmd
:
'nginx -s stop'
})
await
docker
.
execContainerCommand
({
container
,
cmd
:
'nginx -s stop'
})
...
...
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