diff --git a/ds-build/src/main/java/Util/PublishUtil.java b/ds-build/src/main/java/Util/PublishUtil.java index 460e8f5c..965dbab5 100644 --- a/ds-build/src/main/java/Util/PublishUtil.java +++ b/ds-build/src/main/java/Util/PublishUtil.java @@ -70,21 +70,21 @@ public class PublishUtil { ssh.mkdir(remotePath); System.out.println("正在上传Dockerfile..."); - ssh.upload(workingPath + "/Dockerfile", remotePath + "/Dockerfile"); + ssh.upload(workingPath + "Dockerfile", remotePath + "Dockerfile"); if (!StrKit.isBlank(localLibPath)) { System.out.println("正在创建lib目录..."); - ssh.mkdir(remotePath + "/lib"); + ssh.mkdir(remotePath + "lib"); //遍历lib目录下的文件 for (File file : FileUtil.loopFiles(localLibPath)) { System.out.println("正在上传jar包:" + file.getName()); - ssh.upload(file.getAbsolutePath(), remotePath + "/lib/" + file.getName()); + ssh.upload(file.getAbsolutePath(), remotePath + "lib/" + file.getName()); } } if (!StrKit.isBlank(localStatic)) { System.out.println("正在创建" + localStatic + "目录..."); - ssh.mkdir(remotePath + "/" + localStatic); + ssh.mkdir(remotePath + localStatic); //1、需要把目录压缩成ZIP文件 // 将目录打包成ZIP文件,不包含目录本身,只包含目录下的文件和子目录 String localFile = workingPath + localStatic + ".zip"; @@ -92,7 +92,7 @@ public class PublishUtil { ZipUtil.zip(workingPath + localStatic, localFile, true); System.out.println("静态文件打包ZIP已完成,正在上传..."); //2、需要把ZIP文件上传 - ssh.upload(localFile, remotePath + "/" + localStatic + ".zip"); + ssh.upload(localFile, remotePath + localStatic + ".zip"); //3、把ZIP文件在远端解压缩 ssh.exec("cd " + remotePath + " && unzip " + localStatic + ".zip"); ssh.exec("cd " + remotePath + " && rm -rf " + localStatic + ".zip"); @@ -102,7 +102,7 @@ public class PublishUtil { if (!StrKit.isBlank(localNginxConf)) { System.out.println("正在上传nginx.conf..."); File file = new File(localNginxConf); - ssh.upload(file.getAbsolutePath(), remotePath + "/" + file.getName()); + ssh.upload(file.getAbsolutePath(), remotePath + file.getName()); System.out.println("成功完成上传文件nginx.conf"); } //打包target为zip diff --git a/ds-build/src/main/resources/publishImage.json b/ds-build/src/main/resources/publishImage.json index ed07a640..be6c13fb 100644 --- a/ds-build/src/main/resources/publishImage.json +++ b/ds-build/src/main/resources/publishImage.json @@ -6,15 +6,15 @@ "project": [ { "projectName": "ds-gw", - "workingPath": "D:/dsWork/dsExam/ds-gw/", + "workingPath": "D:/dsWork/dsProject/ds-gw/", "localLibPath": "", "localStatic": "static", "localNginxConf": "nginx.conf" }, { "projectName": "ds-base", - "workingPath": "D:/dsWork/dsExam/ds-base/", - "localLibPath": "D:/dsWork/dsExam/ds-base/lib/", + "workingPath": "D:/dsWork/dsProject/ds-base/", + "localLibPath": "D:/dsWork/dsProject/ds-base/lib/", "localStatic": "WebRoot", "localNginxConf": "" } diff --git a/ds-build/target/classes/publishImage.json b/ds-build/target/classes/publishImage.json index ed07a640..be6c13fb 100644 --- a/ds-build/target/classes/publishImage.json +++ b/ds-build/target/classes/publishImage.json @@ -6,15 +6,15 @@ "project": [ { "projectName": "ds-gw", - "workingPath": "D:/dsWork/dsExam/ds-gw/", + "workingPath": "D:/dsWork/dsProject/ds-gw/", "localLibPath": "", "localStatic": "static", "localNginxConf": "nginx.conf" }, { "projectName": "ds-base", - "workingPath": "D:/dsWork/dsExam/ds-base/", - "localLibPath": "D:/dsWork/dsExam/ds-base/lib/", + "workingPath": "D:/dsWork/dsProject/ds-base/", + "localLibPath": "D:/dsWork/dsProject/ds-base/lib/", "localStatic": "WebRoot", "localNginxConf": "" }