update ssh upload

This commit is contained in:
bwcx_jzy 2022-01-21 15:43:16 +08:00
parent e54f1b462c
commit 47cfce70d9
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
4 changed files with 31 additions and 20 deletions

View File

@ -15,6 +15,7 @@
9. 容器构建 9. 容器构建
10. docker ui 10. docker ui
11. 节点大屏 11. 节点大屏
12. 实时阅读日志文件
# 2.7.x # 2.7.x

View File

@ -315,6 +315,10 @@ Agent.sh create 创建Jpom插件端的应用服务jpom-agent
[名词解释](https://jpom.io/docs/index.html#/FQA/%E5%90%8D%E8%AF%8D%E8%A7%A3%E9%87%8A) [名词解释](https://jpom.io/docs/index.html#/FQA/%E5%90%8D%E8%AF%8D%E8%A7%A3%E9%87%8A)
## 整体架构
![jpom-func-arch](https://cdn.jsdelivr.net/gh/jiangzeyin/Jpom-site/images/jpom-func-arch.jpg)
### 交流讨论 、提供bug反馈或建议 ### 交流讨论 、提供bug反馈或建议
1. 微信群二维码添加小助手备注Jpom 进群) 1. 微信群二维码添加小助手备注Jpom 进群)

View File

@ -251,24 +251,30 @@ public class ReleaseManage extends BaseBuild {
} }
Session session = SshService.getSessionByModel(item); Session session = SshService.getSessionByModel(item);
try { try {
try (Sftp sftp = new Sftp(session, item.getCharsetT())) { String releasePath = this.buildExtraModule.getReleasePath();
if (this.buildExtraModule.isClearOld() && StrUtil.isNotEmpty(this.buildExtraModule.getReleasePath())) { if (StrUtil.isEmpty(releasePath)) {
try { this.log("发布目录为空");
sftp.delDir(this.buildExtraModule.getReleasePath()); } else {
} catch (Exception e) { try (Sftp sftp = new Sftp(session, item.getCharsetT())) {
if (!StrUtil.startWithIgnoreCase(e.getMessage(), "No such file")) { String prefix = "";
this.pubLog("清除构建产物失败", e); if (!StrUtil.startWith(releasePath, StrUtil.SLASH)) {
prefix = sftp.pwd();
}
String normalizePath = FileUtil.normalize(prefix + StrUtil.SLASH + releasePath);
if (this.buildExtraModule.isClearOld()) {
try {
sftp.delDir(normalizePath);
} catch (Exception e) {
if (!StrUtil.startWithIgnoreCase(e.getMessage(), "No such file")) {
this.pubLog("清除构建产物失败", e);
}
} }
} }
sftp.syncUpload(this.resultFile, normalizePath);
this.log("ssh ftp upload done");
} catch (Exception e) {
this.pubLog("执行ssh发布异常", e);
} }
String prefix = "";
if (!StrUtil.startWith(this.buildExtraModule.getReleasePath(), StrUtil.SLASH)) {
prefix = sftp.pwd();
}
String normalizePath = FileUtil.normalize(prefix + StrUtil.SLASH + this.buildExtraModule.getReleasePath());
sftp.syncUpload(this.resultFile, normalizePath);
} catch (Exception e) {
this.pubLog("执行ssh发布异常", e);
} }
} finally { } finally {
JschUtil.close(session); JschUtil.close(session);

View File

@ -166,15 +166,15 @@ export default {
}, },
}; };
</script> </script>
<style scoped> <style scoped lang="stylus">
.node-sider { .node-sider {
/* height: calc(100vh - 75px); */ /* height: calc(100vh - 80px); */
min-height: calc(100vh); min-height: calc(100vh - 85px);
overflow-y: auto; overflow-y: auto;
} }
.layout-content { .layout-content {
/* min-height: calc(100vh); */ min-height: calc(100vh - 85px);
/* overflow-y: auto; */ overflow-y: auto;
} }
/* .node-layout { /* .node-layout {
padding: 10px; padding: 10px;