fix 优化 在线构建新增配置文件环境变量测试(BUILD_CONFIG_BRANCH_NAME)

This commit is contained in:
bwcx_jzy 2023-02-14 16:30:13 +08:00
parent fc0de64185
commit acc2427a88
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
2 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,7 @@
### 🐞 解决BUG、优化功能
1. 【all】优化 解压工具支持多种编码格式GBK、UTF8感谢@Again... .
2. 【server】优化 在线构建新增配置文件环境变量测试(`BUILD_CONFIG_BRANCH_NAME`(感谢@阿克苏市姑墨信息科技有限公司)
------

View File

@ -569,6 +569,8 @@ public class BuildExecuteService {
taskData.environmentMapBuilder.put("BUILD_NAME", this.buildExtraModule.getName());
taskData.environmentMapBuilder.put("BUILD_SOURCE_FILE", FileUtil.getAbsolutePath(this.gitFile));
taskData.environmentMapBuilder.put("BUILD_NUMBER_ID", this.taskData.buildInfoModel.getBuildId() + "");
// 配置的分支名称可能存在模糊匹配的情况
taskData.environmentMapBuilder.put("BUILD_CONFIG_BRANCH_NAME", this.taskData.buildInfoModel.getBranchName());
return true;
}
@ -624,6 +626,7 @@ public class BuildExecuteService {
}
// 分支模式
map.put("branchName", newBranchName);
// 真实使用的分支名
taskData.environmentMapBuilder.put("BUILD_BRANCH_NAME", newBranchName);
logRecorder.system("repository [{}] clone pull from {}", branchName, newBranchName);
result = (String[]) plugin.execute("pull", map);