Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化容器构建的目录 #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ public static Set<String> buildKeys() {
return BUILD_MANAGE_MAP.keySet();
}


private final static String TARGET_DIR = "target";


/**
* 创建构建线程池
*/
Expand Down Expand Up @@ -251,7 +255,7 @@ private String packageFile() {
};
if (buildMode != null && buildMode == 1) {
// 容器构建直接下载到 结果目录
File toFile = BuildUtil.getHistoryPackageFile(buildInfoModel.getId(), buildInfoModel.getBuildId(), resultDirFileAction.getPath());
File toFile = BuildUtil.getHistoryPackageFile(buildInfoModel.getId(), buildInfoModel.getBuildId(), TARGET_DIR);
if (!FileUtil.exist(toFile)) {
String format = StrUtil.format("{} 不存在,处理构建产物失败", resultDirFileAction.getPath());
logRecorder.systemError(format);
Expand Down Expand Up @@ -589,7 +593,7 @@ private String dockerCommand() {
String resultFile = FileUtil.normalize(workingDir + StrUtil.SLASH + resultDirFile);
map.put("resultFile", resultFile);
// 产物输出目录
File toFile = BuildUtil.getHistoryPackageFile(buildInfoModelId, buildInfoModel.getBuildId(), resultDirFile);
File toFile = BuildUtil.getHistoryPackageFile(buildInfoModelId, buildInfoModel.getBuildId(), TARGET_DIR);
map.put("resultFileOut", FileUtil.getAbsolutePath(toFile));
IPlugin plugin = PluginFactory.getPlugin(DockerInfoService.DOCKER_PLUGIN_NAME);
try {
Expand Down