Skip to content

Commit

Permalink
支持多种语言脚本模板,兼容老版本字段
Browse files Browse the repository at this point in the history
  • Loading branch information
jsonwan committed Mar 25, 2021
1 parent a74b70d commit 7e92e77
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ class JobScriptAtom : TaskAtom<InnerJobParam> {
""
}
}
// 兼容老版本插件字段
if (StringUtils.isBlank(scriptContent)) {
scriptContent = param.scriptContent
}
scriptContent =
Base64.getEncoder().encodeToString(scriptContent.toByteArray(Charset.forName("UTF-8")))
val scriptParam = Base64.getEncoder().encodeToString(param.scriptParam.toByteArray(Charset.forName("UTF-8")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode
class InnerJobParam : AtomBaseParam() {
val bizId: String = ""
val scriptType: String = ""
val scriptContent: String = ""
// shell脚本内容
var shellScriptContent: String = ""
// bat脚本内容
Expand Down
11 changes: 11 additions & 0 deletions task.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@
"label": "",
"tipStr": "若执行失败,请根据使用的蓝鲸版本点击插件日志中对应的链接前往作业平台查看脚本失败详情,若为脚本执行超时失败,请检查脚本自身逻辑有无死循环或耗时操作,若正常逻辑耗时较长请调整插件的超时参数(If script fail, please click the link in the log and go to Job to check the detail of script failure. If script fail because of timeout, please check whether there is a dead loop or long-time operation in script content. If the normal business logic requires long time, please adjust the timeout parameter of this plugin.)"
},
"scriptContent": {
"label": "脚本内容(Script Content)",
"default": "",
"placeholder": "",
"type": "atom-ace-editor",
"desc": "兼容老版本插件保留下的字段",
"required": false,
"disabled": false,
"hidden": true,
"isSensitive": false
},
"shellScriptContent": {
"type": "atom-ace-editor",
"label": "脚本内容(支持日志环境变量提取)",
Expand Down

0 comments on commit 7e92e77

Please sign in to comment.