瀏覽代碼

update BuildTools

reghao 1 年之前
父節點
當前提交
3d9f5483db

+ 6 - 1
web/src/main/java/cn/reghao/bnt/web/devops/build/chain/BuildTools.java

@@ -110,7 +110,12 @@ public class BuildTools {
         if (codePacker == null) {
             switch (PackType.valueOf(packerDto.getType())) {
                 case docker:
-                    codePacker = new DockerPack(packerDto.getTargetPath(), dockerAuth);
+                    if (dockerAuth != null) {
+                        codePacker = new DockerPack(packerDto.getTargetPath(), dockerAuth);
+                    } else {
+                        codePacker = new DockerPack(packerDto.getTargetPath());
+                    }
+
                     break;
                 default:
                     codePacker = new ZipPack(packerDto.getBinDirname());

+ 5 - 0
web/src/main/java/cn/reghao/bnt/web/devops/build/tool/packer/DockerPack.java

@@ -23,6 +23,11 @@ public class DockerPack implements CodePacker {
         this.docker = new DockerImpl(dockerAuth);
     }
 
+    public DockerPack(String targetPath) {
+        this.targetPath = targetPath;
+        this.docker = new DockerImpl();
+    }
+
     @Override
     public String pack(String appId, String commitId, String appRootPath, String dockerfile) throws Exception {
         int idx = targetPath.lastIndexOf("/");