[ Cmii ] [ Octopus ] - project a lot

This commit is contained in:
zeaslity
2024-03-08 17:23:41 +08:00
parent 52c360eb49
commit 5e80d7baad
56 changed files with 1112 additions and 240 deletions

View File

@@ -6,6 +6,7 @@ import io.wdd.server.beans.po.ProjectInfoPO;
import io.wdd.server.coreService.CoreProjectService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -23,6 +24,43 @@ public class AppFuncScheduler {
@Resource
CoreProjectService coreProjectService;
/**
* 参数固定顺序为 A1C2IP SUPREME N1C2IP A1C1IP A1C1JS M2D2IP KIMMY JACLOVE
* 1 2 3 4 5 6 7 8
*
* @param projectDeployContext
* @param projectInfoPO
* @return
*/
private static ArrayList<String> buildAppFuncArgs(ProjectDeployContext projectDeployContext, ProjectInfoPO projectInfoPO) {
ArrayList<String> appFuncArgs = new ArrayList<>();
String masterIpInV4 = projectDeployContext
.getMasterNode()
.getServerIpInV4();
appFuncArgs.add(masterIpInV4);
appFuncArgs.add(projectInfoPO.getProjectNamespace());
appFuncArgs.add(masterIpInV4);
// A1C1IP
if (StringUtils.isBlank(projectDeployContext
.getMasterNode()
.getServerIpPbV4())) {
appFuncArgs.add(masterIpInV4);
} else {
appFuncArgs.add(projectDeployContext
.getMasterNode()
.getServerIpPbV4());
}
appFuncArgs.add(projectInfoPO.getProjectWebServicePort());
// M2D2IP
appFuncArgs.add(masterIpInV4);
appFuncArgs.add(projectInfoPO.getProjectVersion());
// jackeyLoveFile
appFuncArgs.add("init_5.1.0.tar");
return appFuncArgs;
}
public boolean runProcedure(ProjectDeployContext projectDeployContext) {
// before run
@@ -41,39 +79,6 @@ public class AppFuncScheduler {
return true;
}
/**
* 参数固定顺序为 A1C2IP SUPREME N1C2IP A1C1IP A1C1JS M2D2IP KIMMY JACLOVE
* 1 2 3 4 5 6 7 8
*
* @param projectDeployContext
* @param projectInfoPO
* @return
*/
private static ArrayList<String> buildAppFuncArgs(ProjectDeployContext projectDeployContext, ProjectInfoPO projectInfoPO) {
ArrayList<String> appFuncArgs = new ArrayList<>();
appFuncArgs.add(projectDeployContext
.getMasterNode()
.getServerIpInV4());
appFuncArgs.add(projectInfoPO.getProjectNamespace());
appFuncArgs.add(projectDeployContext
.getMasterNode()
.getServerIpInV4());
appFuncArgs.add(projectDeployContext
.getMasterNode()
.getServerIpPbV4());
appFuncArgs.add(projectInfoPO.getProjectWebServicePort());
// M2D2IP
appFuncArgs.add(projectDeployContext
.getMasterNode()
.getServerIpInV4());
appFuncArgs.add(projectInfoPO.getProjectVersion());
// jackeyLoveFile
appFuncArgs.add("init_5.1.0.tar");
return appFuncArgs;
}
private void beforeRunProcedure(ProjectDeployContext projectDeployContext) {
// 检查是否符合规定

View File

@@ -36,30 +36,36 @@ import static io.wdd.common.config.OctopusObjectMapperConfig.OctopusObjectMapper
@Slf4j(topic = "octopus agent init ")
public class AcceptAgentInitInfo {
public static final HashMap<String, Integer> ALL_SERVER_CITY_INDEX = new HashMap<>(
Map.of(
"Chengdu",
1,
"Shanghai",
2,
"HongKong",
3,
"Seoul",
4,
"Tokyo",
5,
"Phoenix",
6,
"London",
7,
"LosAngeles",
8,
"Beijing",
9,
"Chongqing",
10
)
);
public static final HashMap<String, Integer> ALL_SERVER_CITY_INDEX = new HashMap<>() {{
put("Chengdu",
1);
put("Shanghai",
2);
put("HongKong",
3);
put("Seoul",
4);
put("Tokyo",
5);
put("Phoenix",
6)
;
put("London",
7)
;
put("LosAngeles",
8);
put("Beijing",
9);
put("Chongqing",
10)
;
put("Ziyang",
11);
}};
public static Set<String> ALL_SERVER_ARCH_INFO = new HashSet<>(
Arrays.asList(
"amd64",