Commit be14b492 authored by 王曜嵚 Wang Yaoqin's avatar 王曜嵚 Wang Yaoqin

dev: 在运行时处理配置文件

parent 3b7858a4
......@@ -43,7 +43,6 @@ export default defineEventHandler(async (event) => {
try {
await docker.execContainerCommand({ container, cmd: 'mv -f ../../tenants_config ./projects', dir: '/var/logwire-platform/dist'})
} catch (err) {}
await copyAndCreateServerPropertiesV1InDocker(username)
LogUtil.printInfo(username, '编译完成')
await changeProjectStatus( 'v1', username, 'status', 'compiled')
} catch (err) {
......
......@@ -15,6 +15,7 @@ export default defineEventHandler(async (event) => {
throw new Error('没有创建容器,请先初始化容器')
}
await copyAndCreateServerPropertiesV1InDocker(username)
// 读取 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]
......
import LogUtil from "~/server/utils/log"
import { copyAndCreateGatewayPropertiesV2InDocker, copyAndCreateServerPropertiesV2InDocker } from "~/server/utils/server"
export default defineEventHandler(async (event) => {
let username = event.context.username
......@@ -38,9 +37,6 @@ export default defineEventHandler(async (event) => {
} catch (err) {
}
copyAndCreateServerPropertiesV2InDocker(username)
copyAndCreateGatewayPropertiesV2InDocker(username)
LogUtil.print(username, `[progress] [[1;34mInfo[m] 编译完成 \n`)
await changeProjectStatus( 'v2', username, 'status', 'compiled')
} catch (err) {
......
......@@ -18,6 +18,9 @@ export default defineEventHandler(async (event) => {
throw new Error('没有创建容器,请先初始化容器')
}
await copyAndCreateServerPropertiesV2InDocker(username)
await copyAndCreateGatewayPropertiesV2InDocker(username)
// 有可能本身就关闭了
try {
await docker.execContainerCommand({ container, cmd: 'nginx -s stop'})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment