Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz-dmp-cmdexectool
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
jz-dmp-cmdexectool
Commits
a4f29e47
Commit
a4f29e47
authored
Feb 26, 2021
by
sml
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码提交
parent
2a9c340d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
4 deletions
+13
-4
pom.xml
pom.xml
+1
-1
TaskExecutionContext.java
...xectool/scheduler/server/entity/TaskExecutionContext.java
+7
-0
AbstractCommandExecutor.java
...scheduler/server/worker/task/AbstractCommandExecutor.java
+1
-0
FtpTask.java
...cmdexectool/scheduler/server/worker/task/ftp/FtpTask.java
+1
-1
application-test.yml
src/main/resources/application-test.yml
+2
-2
sftp_download.ftl
src/main/resources/templates/sftp_download.ftl
+1
-0
No files found.
pom.xml
View file @
a4f29e47
...
...
@@ -557,7 +557,7 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<mainClass>
com.jz.
Dmp
Application
</mainClass>
<mainClass>
com.jz.
dmp.cmdexectool.Api
Application
</mainClass>
</configuration>
<!--<dependencies>
<dependency>
...
...
src/main/java/com/jz/dmp/cmdexectool/scheduler/server/entity/TaskExecutionContext.java
View file @
a4f29e47
...
...
@@ -243,6 +243,7 @@ public class TaskExecutionContext implements Serializable {
this
.
setTaskParams
(
JSONObject
.
toJSONString
(
shellParameters
));
this
.
setTaskAppId
(
shellParameters
.
getTaskAppId
());
this
.
setParameters
(
shellParameters
);
this
.
tenantCode
=
"root"
;
}
public
TaskExecutionContext
(
SqlParameters
sqlParameters
,
DmpProjectConfigInfoDto
configInfoDto
)
{
...
...
@@ -251,6 +252,7 @@ public class TaskExecutionContext implements Serializable {
this
.
setTaskParams
(
JSONObject
.
toJSONString
(
sqlParameters
));
this
.
setTaskAppId
(
sqlParameters
.
getTaskAppId
());
this
.
setParameters
(
sqlParameters
);
this
.
tenantCode
=
"root"
;
}
public
TaskExecutionContext
(
FtpParameters
ftpParameters
,
DmpProjectConfigInfoDto
configInfoDto
)
{
...
...
@@ -259,6 +261,7 @@ public class TaskExecutionContext implements Serializable {
this
.
setTaskParams
(
JSONObject
.
toJSONString
(
ftpParameters
));
this
.
setTaskAppId
(
ftpParameters
.
getTaskAppId
());
this
.
setParameters
(
ftpParameters
);
this
.
tenantCode
=
"root"
;
}
public
TaskExecutionContext
(
UnzipfileParameters
unzipfileParameters
,
DmpProjectConfigInfoDto
configInfoDto
)
{
...
...
@@ -267,6 +270,7 @@ public class TaskExecutionContext implements Serializable {
this
.
setTaskParams
(
JSONObject
.
toJSONString
(
unzipfileParameters
));
this
.
setTaskAppId
(
unzipfileParameters
.
getTaskAppId
());
this
.
setParameters
(
unzipfileParameters
);
this
.
tenantCode
=
"root"
;
}
public
TaskExecutionContext
(
DoctransParameters
doctransParameters
,
DmpProjectConfigInfoDto
configInfoDto
)
{
...
...
@@ -275,6 +279,7 @@ public class TaskExecutionContext implements Serializable {
this
.
setTaskParams
(
JSONObject
.
toJSONString
(
doctransParameters
));
this
.
setTaskAppId
(
doctransParameters
.
getTaskAppId
());
this
.
setParameters
(
doctransParameters
);
this
.
tenantCode
=
"root"
;
}
public
TaskExecutionContext
(
HdfsParameters
hdfsParameters
,
DmpProjectConfigInfoDto
configInfoDto
)
{
...
...
@@ -283,6 +288,7 @@ public class TaskExecutionContext implements Serializable {
this
.
setTaskParams
(
JSONObject
.
toJSONString
(
hdfsParameters
));
this
.
setTaskAppId
(
hdfsParameters
.
getTaskAppId
());
this
.
setParameters
(
hdfsParameters
);
this
.
tenantCode
=
"root"
;
}
public
TaskExecutionContext
(
SyncParameters
syncParameters
,
DmpProjectConfigInfoDto
configInfoDto
)
{
...
...
@@ -291,6 +297,7 @@ public class TaskExecutionContext implements Serializable {
this
.
setTaskParams
(
JSONObject
.
toJSONString
(
syncParameters
));
this
.
setTaskAppId
(
syncParameters
.
getTaskAppId
());
this
.
setParameters
(
syncParameters
);
this
.
tenantCode
=
"root"
;
}
public
int
getTaskInstanceId
()
{
...
...
src/main/java/com/jz/dmp/cmdexectool/scheduler/server/worker/task/AbstractCommandExecutor.java
View file @
a4f29e47
...
...
@@ -154,6 +154,7 @@ public abstract class AbstractCommandExecutor {
command
.
add
(
commandFile
);
// setting commands
logger
.
info
(
"executor shell command【{}】"
,
command
);
processBuilder
.
command
(
command
);
process
=
processBuilder
.
start
();
}
...
...
src/main/java/com/jz/dmp/cmdexectool/scheduler/server/worker/task/ftp/FtpTask.java
View file @
a4f29e47
...
...
@@ -108,7 +108,7 @@ public class FtpTask extends AbstractTask {
*/
private
String
buildCommand
()
throws
Exception
{
// generate scripts
String
fileName
=
String
.
format
(
"%s/%s_node.%s"
,
taskExecutionContext
.
getExecutePath
(),
String
fileName
=
String
.
format
(
"%s/%s_node
2
.%s"
,
taskExecutionContext
.
getExecutePath
(),
taskExecutionContext
.
getTaskAppId
(),
OSUtils
.
isWindows
()
?
"bat"
:
"sh"
);
Path
path
=
new
File
(
fileName
).
toPath
();
...
...
src/main/resources/application-test.yml
View file @
a4f29e47
# 测试环境配置
server
:
port
:
718
1
port
:
718
3
#contextPath: /resource
management
:
port
:
5400
1
port
:
5400
3
health
:
mail
:
enabled
:
false
...
...
src/main/resources/templates/sftp_download.ftl
View file @
a4f29e47
#!/bin/bash
# sftp 服务器IP地址
ip
=
${
ip
!
}
# sftp 服务器端口号
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment