feature(cli): 增加 cli 模块
cli 模块批量生成服务启停脚本
This commit is contained in:
22
service-cli/service-cli-core/pom.xml
Normal file
22
service-cli/service-cli-core/pom.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.lanyuanxiaoyao</groupId>
|
||||
<artifactId>service-cli</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>service-cli-core</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.16</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.lanyuanxiaoyao.service.cli.core;
|
||||
|
||||
/**
|
||||
* 主机
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-05-17
|
||||
*/
|
||||
public class HostInfo {
|
||||
private String host;
|
||||
private String ip;
|
||||
private Boolean useAuthority = false;
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public Boolean getUseAuthority() {
|
||||
return useAuthority;
|
||||
}
|
||||
|
||||
public void setUseAuthority(Boolean useAuthority) {
|
||||
this.useAuthority = useAuthority;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HostInfo{" +
|
||||
"host='" + host + '\'' +
|
||||
", ip='" + ip + '\'' +
|
||||
", useAuthority=" + useAuthority +
|
||||
", username='" + username + '\'' +
|
||||
", password='" + password + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.lanyuanxiaoyao.service.cli.core;
|
||||
|
||||
/**
|
||||
* 运行配置
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-05-17
|
||||
*/
|
||||
public class RuntimeInfo {
|
||||
private String user;
|
||||
private String jarPath;
|
||||
private String jdkPath;
|
||||
private String logPath;
|
||||
private String dataPath;
|
||||
private String kerberosKeytabPath;
|
||||
private String lokiUrl;
|
||||
private String zkUrl;
|
||||
private String eurekaUrl;
|
||||
private HudiInfo hudi;
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(String user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public String getJarPath() {
|
||||
return jarPath;
|
||||
}
|
||||
|
||||
public void setJarPath(String jarPath) {
|
||||
this.jarPath = jarPath;
|
||||
}
|
||||
|
||||
public String getJdkPath() {
|
||||
return jdkPath;
|
||||
}
|
||||
|
||||
public void setJdkPath(String jdkPath) {
|
||||
this.jdkPath = jdkPath;
|
||||
}
|
||||
|
||||
public String getLogPath() {
|
||||
return logPath;
|
||||
}
|
||||
|
||||
public void setLogPath(String logPath) {
|
||||
this.logPath = logPath;
|
||||
}
|
||||
|
||||
public String getDataPath() {
|
||||
return dataPath;
|
||||
}
|
||||
|
||||
public void setDataPath(String dataPath) {
|
||||
this.dataPath = dataPath;
|
||||
}
|
||||
|
||||
public String getKerberosKeytabPath() {
|
||||
return kerberosKeytabPath;
|
||||
}
|
||||
|
||||
public void setKerberosKeytabPath(String kerberosKeytabPath) {
|
||||
this.kerberosKeytabPath = kerberosKeytabPath;
|
||||
}
|
||||
|
||||
public String getLokiUrl() {
|
||||
return lokiUrl;
|
||||
}
|
||||
|
||||
public void setLokiUrl(String lokiUrl) {
|
||||
this.lokiUrl = lokiUrl;
|
||||
}
|
||||
|
||||
public String getZkUrl() {
|
||||
return zkUrl;
|
||||
}
|
||||
|
||||
public void setZkUrl(String zkUrl) {
|
||||
this.zkUrl = zkUrl;
|
||||
}
|
||||
|
||||
public String getEurekaUrl() {
|
||||
return eurekaUrl;
|
||||
}
|
||||
|
||||
public void setEurekaUrl(String eurekaUrl) {
|
||||
this.eurekaUrl = eurekaUrl;
|
||||
}
|
||||
|
||||
public HudiInfo getHudi() {
|
||||
return hudi;
|
||||
}
|
||||
|
||||
public void setHudi(HudiInfo hudi) {
|
||||
this.hudi = hudi;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RuntimeInfo{" +
|
||||
"user='" + user + '\'' +
|
||||
", jarPath='" + jarPath + '\'' +
|
||||
", jdkPath='" + jdkPath + '\'' +
|
||||
", logPath='" + logPath + '\'' +
|
||||
", dataPath='" + dataPath + '\'' +
|
||||
", kerberosKeytabPath='" + kerberosKeytabPath + '\'' +
|
||||
", lokiUrl='" + lokiUrl + '\'' +
|
||||
", zkUrl='" + zkUrl + '\'' +
|
||||
", eurekaUrl='" + eurekaUrl + '\'' +
|
||||
", hudi=" + hudi +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static final class HudiInfo {
|
||||
private String appHdfsPath;
|
||||
private String archiveHdfsPath;
|
||||
private String victoriaPushUrl;
|
||||
|
||||
public String getAppHdfsPath() {
|
||||
return appHdfsPath;
|
||||
}
|
||||
|
||||
public void setAppHdfsPath(String appHdfsPath) {
|
||||
this.appHdfsPath = appHdfsPath;
|
||||
}
|
||||
|
||||
public String getArchiveHdfsPath() {
|
||||
return archiveHdfsPath;
|
||||
}
|
||||
|
||||
public void setArchiveHdfsPath(String archiveHdfsPath) {
|
||||
this.archiveHdfsPath = archiveHdfsPath;
|
||||
}
|
||||
|
||||
public String getVictoriaPushUrl() {
|
||||
return victoriaPushUrl;
|
||||
}
|
||||
|
||||
public void setVictoriaPushUrl(String victoriaPushUrl) {
|
||||
this.victoriaPushUrl = victoriaPushUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HudiInfo{" +
|
||||
"appHdfsPath='" + appHdfsPath + '\'' +
|
||||
", archiveHdfsPath='" + archiveHdfsPath + '\'' +
|
||||
", victoriaPushUrl='" + victoriaPushUrl + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.lanyuanxiaoyao.service.cli.core;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 服务配置
|
||||
*
|
||||
* @author lanyuanxiaoyao
|
||||
* @date 2023-05-17
|
||||
*/
|
||||
public class ServiceInfo {
|
||||
private String name;
|
||||
private Integer replicas = 0;
|
||||
private String sourceJar;
|
||||
private Map<String, Object> environments = new HashMap<>();
|
||||
private Map<String, Object> arguments = new HashMap<>();
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getReplicas() {
|
||||
return replicas;
|
||||
}
|
||||
|
||||
public void setReplicas(Integer replicas) {
|
||||
this.replicas = replicas;
|
||||
}
|
||||
|
||||
public String getSourceJar() {
|
||||
return sourceJar;
|
||||
}
|
||||
|
||||
public void setSourceJar(String sourceJar) {
|
||||
this.sourceJar = sourceJar;
|
||||
}
|
||||
|
||||
public Map<String, Object> getEnvironments() {
|
||||
return environments;
|
||||
}
|
||||
|
||||
public void setEnvironments(Map<String, Object> environments) {
|
||||
this.environments = environments;
|
||||
}
|
||||
|
||||
public Map<String, Object> getArguments() {
|
||||
return arguments;
|
||||
}
|
||||
|
||||
public void setArguments(Map<String, Object> arguments) {
|
||||
this.arguments = arguments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ServiceInfo{" +
|
||||
"name='" + name + '\'' +
|
||||
", replicas=" + replicas +
|
||||
", sourceJar='" + sourceJar + '\'' +
|
||||
", environments=" + environments +
|
||||
", arguments=" + arguments +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user