Commit 969a129b authored by 赵啸非's avatar 赵啸非

修改部署脚本

parent 1da222bb
...@@ -26,6 +26,11 @@ ...@@ -26,6 +26,11 @@
<outputDirectory>db</outputDirectory> <outputDirectory>db</outputDirectory>
<fileMode>0755</fileMode> <fileMode>0755</fileMode>
</fileSet> </fileSet>
<fileSet>
<directory>./project</directory>
<outputDirectory>project</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
</fileSets> </fileSets>
<files> <files>
<file> <file>
......
...@@ -17,10 +17,7 @@ import com.mortals.xhx.module.setup.mode.SiteEntity; ...@@ -17,10 +17,7 @@ import com.mortals.xhx.module.setup.mode.SiteEntity;
import com.mortals.xhx.module.setup.service.SetupDbService; import com.mortals.xhx.module.setup.service.SetupDbService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.io.BufferedReader; import java.io.*;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
...@@ -83,8 +80,16 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec ...@@ -83,8 +80,16 @@ public class SetupProjectServiceImpl extends AbstractCRUDServiceImpl<SetupProjec
} else { } else {
//读取本工程的资源文件 检测压缩包类型 //读取本工程的资源文件 检测压缩包类型
String sourcePath = "/project/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getDesc() + "/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getValue() + ".tar.gz"; //String sourcePath = "/project/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getDesc() + "/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getValue() + ".tar.gz";
InputStream inputStream = this.getClass().getResourceAsStream(sourcePath); //InputStream inputStream = this.getClass().getResourceAsStream(sourcePath);
String sourcePath = "./../project/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getDesc() + "/" + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getValue() + ".tar.gz";
File file = new File(sourcePath);
log.info("文件存在:{}", file.exists());
InputStream inputStream = FileUtil.getInputStream(file);
ZipUtils.unGzip(inputStream, setupProjectEntity.getProjectPath()); ZipUtils.unGzip(inputStream, setupProjectEntity.getProjectPath());
String publicPath = setupProjectEntity.getProjectPath() + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getValue(); String publicPath = setupProjectEntity.getProjectPath() + ProductDisEnum.getByValue(setupProjectEntity.getProjectCode()).getValue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment