From 589159c025db366b1bbcc3847b90fc7fdd3986c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B0=8F=E4=BA=91?= Date: Fri, 9 Jan 2026 18:47:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9ANode.js=20=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=9C=A8=E5=AD=90=E6=A8=A1=E5=9D=97=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=9E=84=E5=BB=BA=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devops/deployer.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.devops/deployer.py b/.devops/deployer.py index 8d3d930..48a21bc 100644 --- a/.devops/deployer.py +++ b/.devops/deployer.py @@ -155,10 +155,20 @@ class Deployer: self.logger.info(f"开始构建: {repo_config['name']}") - # 执行构建命令(在主仓库根目录执行) + # 根据项目类型选择执行目录 + if repo_config['type'] == 'nodejs': + # Node.js 项目在子模块目录执行 + build_dir = repo_path / repo_config['path'] + self.logger.info(f"Node.js 项目,在子模块目录执行构建") + else: + # Java 项目在主仓库根目录执行 + build_dir = repo_path + self.logger.info(f"Java 项目,在主仓库根目录执行构建") + + # 执行构建命令 for cmd in repo_config['build_commands']: self.logger.info(f"执行构建命令: {cmd}") - if not self.run_command(cmd, cwd=repo_path, timeout=1800): + if not self.run_command(cmd, cwd=build_dir, timeout=1800): self.logger.error(f"构建失败: {cmd}") return False