|
@@ -3,6 +3,7 @@ package cn.reghao.bnt.web.config.spring;
|
|
|
import cn.reghao.bnt.web.account.service.AccountService;
|
|
import cn.reghao.bnt.web.account.service.AccountService;
|
|
|
import cn.reghao.bnt.web.account.service.FileService;
|
|
import cn.reghao.bnt.web.account.service.FileService;
|
|
|
import cn.reghao.bnt.web.account.service.RoleService;
|
|
import cn.reghao.bnt.web.account.service.RoleService;
|
|
|
|
|
+import cn.reghao.bnt.web.config.AppProperties;
|
|
|
import cn.reghao.bnt.web.devops.app.db.repository.config.build.CompilerConfigRepository;
|
|
import cn.reghao.bnt.web.devops.app.db.repository.config.build.CompilerConfigRepository;
|
|
|
import cn.reghao.bnt.web.devops.app.model.po.config.build.CompilerConfig;
|
|
import cn.reghao.bnt.web.devops.app.model.po.config.build.CompilerConfig;
|
|
|
import cn.reghao.bnt.web.devops.app.service.bd.BuildStat;
|
|
import cn.reghao.bnt.web.devops.app.service.bd.BuildStat;
|
|
@@ -40,11 +41,12 @@ public class AppLifecycle implements ApplicationRunner, DisposableBean {
|
|
|
private final AccountService accountService;
|
|
private final AccountService accountService;
|
|
|
private final SysMessageRepository sysMessageRepository;
|
|
private final SysMessageRepository sysMessageRepository;
|
|
|
private BuildStat buildStat;
|
|
private BuildStat buildStat;
|
|
|
|
|
+ private AppProperties appProperties;
|
|
|
|
|
|
|
|
public AppLifecycle(BuildDirService buildDirService, MachineService machineService, LogHandler logHandler,
|
|
public AppLifecycle(BuildDirService buildDirService, MachineService machineService, LogHandler logHandler,
|
|
|
CompilerConfigRepository compilerConfigRepository, FileService fileService,
|
|
CompilerConfigRepository compilerConfigRepository, FileService fileService,
|
|
|
RoleService roleService, AccountService accountService, SysMessageRepository sysMessageRepository,
|
|
RoleService roleService, AccountService accountService, SysMessageRepository sysMessageRepository,
|
|
|
- BuildStat buildStat) {
|
|
|
|
|
|
|
+ BuildStat buildStat, AppProperties appProperties) {
|
|
|
this.buildDirService = buildDirService;
|
|
this.buildDirService = buildDirService;
|
|
|
this.machineService = machineService;
|
|
this.machineService = machineService;
|
|
|
this.logHandler = logHandler;
|
|
this.logHandler = logHandler;
|
|
@@ -54,6 +56,7 @@ public class AppLifecycle implements ApplicationRunner, DisposableBean {
|
|
|
this.accountService = accountService;
|
|
this.accountService = accountService;
|
|
|
this.sysMessageRepository = sysMessageRepository;
|
|
this.sysMessageRepository = sysMessageRepository;
|
|
|
this.buildStat = buildStat;
|
|
this.buildStat = buildStat;
|
|
|
|
|
+ this.appProperties = appProperties;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -100,7 +103,7 @@ public class AppLifecycle implements ApplicationRunner, DisposableBean {
|
|
|
@Deprecated
|
|
@Deprecated
|
|
|
private void initBuildDir() {
|
|
private void initBuildDir() {
|
|
|
String userDir = System.getProperty("user.dir");
|
|
String userDir = System.getProperty("user.dir");
|
|
|
- String baseDir = String.format("%s/bnt_data", userDir);
|
|
|
|
|
|
|
+ String baseDir = appProperties.getBaseDir();
|
|
|
File dir = new File(baseDir);
|
|
File dir = new File(baseDir);
|
|
|
if (!dir.exists() && !dir.mkdirs()) {
|
|
if (!dir.exists() && !dir.mkdirs()) {
|
|
|
log.error("创建本地构建目录 {} 失败,bnt-web 结束运行", baseDir);
|
|
log.error("创建本地构建目录 {} 失败,bnt-web 结束运行", baseDir);
|