|
@@ -52,6 +52,15 @@ public class DeployApp {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void addAgentConfig(RemoteAgentConfig remoteAgentConfig) {
|
|
public void addAgentConfig(RemoteAgentConfig remoteAgentConfig) {
|
|
|
|
|
+ String nodeType = remoteAgentConfig.getNodeType();
|
|
|
|
|
+ if (nodeType.equals(NodeType.mgr.name())) {
|
|
|
|
|
+ remoteAgentConfig.setMgrProtocol(null);
|
|
|
|
|
+ remoteAgentConfig.setMgrHost(null);
|
|
|
|
|
+ remoteAgentConfig.setMgrPort(null);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ remoteAgentConfig.setMgrConfig(null);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
RemoteAgentConfig entity = remoteAgentConfigRepository.findByMgrHost(remoteAgentConfig.getMgrHost());
|
|
RemoteAgentConfig entity = remoteAgentConfigRepository.findByMgrHost(remoteAgentConfig.getMgrHost());
|
|
|
if (entity == null) {
|
|
if (entity == null) {
|
|
|
remoteAgentConfigRepository.save(remoteAgentConfig);
|
|
remoteAgentConfigRepository.save(remoteAgentConfig);
|
|
@@ -62,9 +71,9 @@ public class DeployApp {
|
|
|
remoteAgentConfigRepository.deleteById(id);
|
|
remoteAgentConfigRepository.deleteById(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public List<RemoteAgentConfig> getAgentConfigs() {
|
|
|
|
|
|
|
+ public List<RemoteAgentConfig> getAgentConfigs(String nodeType) {
|
|
|
PageRequest pageRequest = PageRequest.of(0, 100);
|
|
PageRequest pageRequest = PageRequest.of(0, 100);
|
|
|
- return remoteAgentConfigRepository.findAll(pageRequest).getContent();
|
|
|
|
|
|
|
+ return remoteAgentConfigRepository.findByNodeType(nodeType, pageRequest).getContent();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Result addRemoteHost(RemoteMachine remoteMachine) {
|
|
public Result addRemoteHost(RemoteMachine remoteMachine) {
|
|
@@ -118,10 +127,6 @@ public class DeployApp {
|
|
|
return remoteHostRepository.findByNodeType(nodeType, pageRequest).getContent();
|
|
return remoteHostRepository.findByNodeType(nodeType, pageRequest).getContent();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public String getMgrConfig() {
|
|
|
|
|
- return "mgr config";
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public Result deployApp(UpdateApp updateApp) {
|
|
public Result deployApp(UpdateApp updateApp) {
|
|
|
AppConfig appConfig = appBuildQuery.getAppConfig(appId);
|
|
AppConfig appConfig = appBuildQuery.getAppConfig(appId);
|
|
|
if (appConfig == null) {
|
|
if (appConfig == null) {
|