refactor: 适配 apps/web·server·license-server 目录的部署与插件路径

This commit is contained in:
2026-09-16 22:56:24 +08:00
parent 2754ed1e45
commit 8c56cfb0b5
8 changed files with 161 additions and 41 deletions
+8 -8
View File
@@ -46,7 +46,7 @@
Docker 资源名同样带环境后缀:`ecom-backend-test` / `ecom-backend-prod` 等。
本地编译产物统一放在 `ecom-deploy/artifacts/`(已 gitignore):
本地编译产物统一放在 `deploy/artifacts/`(已 gitignore):
```
artifacts/
@@ -60,7 +60,7 @@ artifacts/
## 方式一:TUI 菜单(推荐)
```bash
cd ecom-deploy
cd deploy
pnpm dev
```
@@ -81,26 +81,26 @@ pnpm dev
**后端**
```bash
cd ecom-dmb-backend
cd apps/server
./mvnw clean package -DskipTests # Windows: mvnw.cmd
cp target/ecom-dmb-backend-*.jar ../ecom-deploy/artifacts/backend/app.jar
cp target/ecom-dmb-backend-*.jar ../../deploy/artifacts/backend/app.jar
```
**前端**
```bash
cd ecom-dmb-frontend
cd apps/web
pnpm install && pnpm build
cp -r apps/web-antd/dist/* ../ecom-deploy/artifacts/frontend/
cp -r apps/web-antd/dist/* ../../deploy/artifacts/frontend/
```
**许可证**
```bash
cd ecom-license/server
cd apps/license-server/server
pnpm install && pnpm build
# 将 dist、package.json、pnpm-lock.yaml、keys、.env 复制到 artifacts/license/
cd ../../ecom-deploy/artifacts/license
cd ../../../deploy/artifacts/license
pnpm install --prod --frozen-lockfile
```
+7 -11
View File
@@ -93,7 +93,7 @@ export function getConfigPath(): string {
return CONFIG_PATH;
}
/** 本地编译产物根目录 ecom-deploy/artifacts */
/** 本地编译产物根目录 deploy/artifacts */
export function getArtifactsRoot(): string {
return ARTIFACTS_ROOT;
}
@@ -213,29 +213,25 @@ export async function syncServerKeyAuth(
const PROJECT_ROOT = join(__dirname, '..', '..');
export function getFrontendDir(): string {
return join(PROJECT_ROOT, 'ecom-dmb-frontend');
return join(PROJECT_ROOT, 'apps', 'web');
}
export function getBackendDir(): string {
return join(PROJECT_ROOT, 'ecom-dmb-backend');
return join(PROJECT_ROOT, 'apps', 'server');
}
export function getLicenseDir(): string {
return join(PROJECT_ROOT, 'ecom-license');
}
function getProjectDeployDir(project: string): string {
return join(PROJECT_ROOT, project, 'deploy');
return join(PROJECT_ROOT, 'apps', 'license-server');
}
export function getFrontendDeployDir(): string {
return getProjectDeployDir('ecom-dmb-frontend');
return join(PROJECT_ROOT, 'apps', 'web', 'deploy');
}
export function getBackendDeployDir(): string {
return getProjectDeployDir('ecom-dmb-backend');
return join(PROJECT_ROOT, 'apps', 'server', 'deploy');
}
export function getLicenseDeployDir(): string {
return getProjectDeployDir('ecom-license');
return join(PROJECT_ROOT, 'apps', 'license-server', 'deploy');
}