|
|
@@ -15,20 +15,23 @@ import java.io.File;
|
|
|
@Slf4j
|
|
|
public class ZipPack implements CodePacker {
|
|
|
private final String targetPath;
|
|
|
+ private String binfilesDirname;
|
|
|
|
|
|
public ZipPack(PackerConfig packerConfig) {
|
|
|
this.targetPath = packerConfig.getType().equals(PackType.zip.getName()) ?
|
|
|
LocalBuildDir.packDir : packerConfig.getTargetPath();
|
|
|
+ this.binfilesDirname = packerConfig.getBinfilesDirname();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String pack(String appId, String commitId, String appCompileHome) throws Exception {
|
|
|
+ public String pack(String appId, String commitId, String appRootPath) throws Exception {
|
|
|
+ String binfilesDirPath = appRootPath + File.separator + binfilesDirname;
|
|
|
String filename = String.format("%s_%s.zip", appId, commitId);
|
|
|
String dst = targetPath + File.separator + filename;
|
|
|
if (new File(dst).exists()) {
|
|
|
throw new Exception(dst + " 已存在");
|
|
|
}
|
|
|
- ZipFiles.zip(new File(appCompileHome), dst);
|
|
|
+ ZipFiles.zip(new File(binfilesDirPath), dst);
|
|
|
|
|
|
return String.format("http://localhost:4020/api/sys/package/%s", filename);
|
|
|
}
|