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

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

parent 3b7858a4
...@@ -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) {
......
...@@ -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]
......
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) {
......
...@@ -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'})
......
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