Compare commits

...

2 Commits

Author SHA1 Message Date
孙小云 4962ae4b2f Merge branch 'main' of http://th.local.t-aaron.com:13000/THENG/a-cloud-all 2026-01-10 13:27:58 +08:00
孙小云 c73482e827 xx 2026-01-10 13:27:53 +08:00
1 changed files with 6 additions and 1 deletions

View File

@ -294,10 +294,15 @@ class Deployer:
commit_msg = self.config['deploy']['commit_message'].format(
repo_name=repo_config['name']
)
if not self.run_command(f'git commit -m "{commit_msg}"', cwd=repo_path):
return False
# 推送前先拉取远程最新代码
self.logger.info("推送前先拉取远程最新代码...")
if not self.run_command(f"git pull --rebase origin {self.main_repo_branch}", cwd=repo_path):
self.logger.warning("拉取远程代码失败,尝试直接推送")
# 推送到远程
if not self.run_command(f"git push origin {self.main_repo_branch}", cwd=repo_path):
self.logger.warning("推送失败,但部署已完成")