[ Cmii ] [ Octopus ] - real project
This commit is contained in:
@@ -188,6 +188,7 @@ func ImageTagFromListAndPushToCHarbor(referenceImageList []string, targetHarborH
|
|||||||
pushResult := ImagePushToOctopusKindHarbor(targetImageName)
|
pushResult := ImagePushToOctopusKindHarbor(targetImageName)
|
||||||
if pushResult == nil {
|
if pushResult == nil {
|
||||||
errorPushImageNameList = append(errorPushImageNameList, cmiiImageFullName)
|
errorPushImageNameList = append(errorPushImageNameList, cmiiImageFullName)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
scanner := bufio.NewScanner(pushResult)
|
scanner := bufio.NewScanner(pushResult)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
@@ -265,7 +266,6 @@ func ImagePullCMiiFromFileJson(filePathName string) {
|
|||||||
func ImagePullFromFullNameList(fullImageNameList []string) (errorPullImageList []string) {
|
func ImagePullFromFullNameList(fullImageNameList []string) (errorPullImageList []string) {
|
||||||
|
|
||||||
for _, dep := range fullImageNameList {
|
for _, dep := range fullImageNameList {
|
||||||
loginToDockerHub()
|
|
||||||
|
|
||||||
pullResult := ImagePullFromCmiiHarbor(dep)
|
pullResult := ImagePullFromCmiiHarbor(dep)
|
||||||
if pullResult == nil {
|
if pullResult == nil {
|
||||||
@@ -451,16 +451,20 @@ func convertCMiiImageMapToList(cmiiImageVersionMap map[string]string) (fullImage
|
|||||||
return fullImageNameList
|
return fullImageNameList
|
||||||
}
|
}
|
||||||
|
|
||||||
func loginToDockerHub() {
|
func loginToDockerHub(HarborFullHost string) {
|
||||||
|
|
||||||
|
if HarborFullHost == "" {
|
||||||
|
HarborFullHost = "https://registry-1.docker.io"
|
||||||
|
}
|
||||||
|
|
||||||
login, err := apiClient.RegistryLogin(context.TODO(), types.AuthConfig{
|
login, err := apiClient.RegistryLogin(context.TODO(), types.AuthConfig{
|
||||||
Username: "icederce",
|
Username: "icederce",
|
||||||
Password: "loveff.cxc.23",
|
Password: "loveff.cxc.23",
|
||||||
Auth: "aWNlZGVyY2U6bG92ZWZmLmN4Yy4yMw==",
|
Auth: "aWNlZGVyY2U6bG92ZWZmLmN4Yy4yMw==",
|
||||||
ServerAddress: "https://registry-1.docker.io",
|
ServerAddress: HarborFullHost,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorF("[loginToDockerHub] - login failed !")
|
log.ErrorF("[loginToDockerHub] - login to %s failed !", HarborFullHost)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.DebugF("[loginToDockerHub] - login is %s", login.Status)
|
log.DebugF("[loginToDockerHub] - login is %s", login.Status)
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import (
|
|||||||
|
|
||||||
const OfflineImageGzipFolderPrefix = "/root/octopus_image/"
|
const OfflineImageGzipFolderPrefix = "/root/octopus_image/"
|
||||||
const OfflineDeployHarborHost = "harbor.wdd.io"
|
const OfflineDeployHarborHost = "harbor.wdd.io"
|
||||||
|
const PublicDeployHarborHost = "42.192.52.227"
|
||||||
|
const DirectPushDeployHarborHost = "36.134.28.60"
|
||||||
|
|
||||||
func FetchDemoImages(projectName string, gzipSplit bool) (errorPullImageList, errorGzipImageList []string) {
|
func FetchDemoImages(projectName string, gzipSplit bool) (errorPullImageList, errorGzipImageList []string) {
|
||||||
|
|
||||||
@@ -104,10 +106,10 @@ func LoadSplitGzipImageToTargetHarbor(projectName, targetHarborHost string) (err
|
|||||||
|
|
||||||
func LoadSplitDepGzipImageToTargetHarbor(targetHarborHost string) (errorLoadImageNameList []string, errorPushImageNameList []string) {
|
func LoadSplitDepGzipImageToTargetHarbor(targetHarborHost string) (errorLoadImageNameList []string, errorPushImageNameList []string) {
|
||||||
|
|
||||||
middle := OfflineImageGzipFolderPrefix + "middle/"
|
//middle := OfflineImageGzipFolderPrefix + "middle/"
|
||||||
rke := OfflineImageGzipFolderPrefix + "rke/"
|
//rke := OfflineImageGzipFolderPrefix + "rke/"
|
||||||
errorLoadImageNameList = append(errorLoadImageNameList, ImageLoadFromFolderPath(middle)...)
|
//errorLoadImageNameList = append(errorLoadImageNameList, ImageLoadFromFolderPath(middle)...)
|
||||||
errorLoadImageNameList = append(errorLoadImageNameList, ImageLoadFromFolderPath(rke)...)
|
//errorLoadImageNameList = append(errorLoadImageNameList, ImageLoadFromFolderPath(rke)...)
|
||||||
|
|
||||||
errorPushImageNameList = append(errorPushImageNameList, ImageTagFromListAndPushToCHarbor(MiddlewareAmd64, targetHarborHost)...)
|
errorPushImageNameList = append(errorPushImageNameList, ImageTagFromListAndPushToCHarbor(MiddlewareAmd64, targetHarborHost)...)
|
||||||
errorPushImageNameList = append(errorPushImageNameList, ImageTagFromListAndPushToCHarbor(Rancher1204Amd64, targetHarborHost)...)
|
errorPushImageNameList = append(errorPushImageNameList, ImageTagFromListAndPushToCHarbor(Rancher1204Amd64, targetHarborHost)...)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ func TestLoadSplitGzipImageToTargetHarbor(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestLoadSplitDepGzipImageToTargetHarbor(t *testing.T) {
|
func TestLoadSplitDepGzipImageToTargetHarbor(t *testing.T) {
|
||||||
errorLoadImageNameList, errorPushImageNameList := LoadSplitDepGzipImageToTargetHarbor(OfflineDeployHarborHost)
|
errorLoadImageNameList, errorPushImageNameList := LoadSplitDepGzipImageToTargetHarbor(DirectPushDeployHarborHost)
|
||||||
|
|
||||||
utils.BeautifulPrintListWithTitle(errorLoadImageNameList, "errorLoadImageNameList")
|
utils.BeautifulPrintListWithTitle(errorLoadImageNameList, "errorLoadImageNameList")
|
||||||
utils.BeautifulPrintListWithTitle(errorPushImageNameList, "errorPushImageNameList")
|
utils.BeautifulPrintListWithTitle(errorPushImageNameList, "errorPushImageNameList")
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ var MiddlewareAmd64 = []string{
|
|||||||
"redis:6.0.20-alpine",
|
"redis:6.0.20-alpine",
|
||||||
"dyrnq/nfs-subdir-external-provisioner:v4.0.2",
|
"dyrnq/nfs-subdir-external-provisioner:v4.0.2",
|
||||||
"busybox:latest",
|
"busybox:latest",
|
||||||
"harbor.cdcyy.com.cn/cmii/cmii-live-operator:5.2.0",
|
|
||||||
"harbor.cdcyy.com.cn/cmii/cmii-srs-oss-adaptor:2023-SA",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var Rancher1204Amd64 = []string{
|
var Rancher1204Amd64 = []string{
|
||||||
@@ -95,6 +93,78 @@ var Rancher1204Amd64 = []string{
|
|||||||
"rancher/system-upgrade-controller:v0.6.2",
|
"rancher/system-upgrade-controller:v0.6.2",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var CmiiSRSImageList = []string{
|
||||||
|
"harbor.cdcyy.com.cn/cmii/cmii-live-operator:5.2.0",
|
||||||
|
"harbor.cdcyy.com.cn/cmii/cmii-srs-oss-adaptor:2023-SA",
|
||||||
|
}
|
||||||
|
|
||||||
|
var Cmii530DemoImageList = []string{
|
||||||
|
"cmii-admin-data:5.2.0",
|
||||||
|
"cmii-admin-gateway:5.2.0",
|
||||||
|
"cmii-admin-user:5.2.0",
|
||||||
|
"cmii-app-release:4.2.0-validation",
|
||||||
|
"cmii-open-gateway:5.2.0",
|
||||||
|
"cmii-suav-supervision:5.2.0",
|
||||||
|
"cmii-uav-airspace:5.2.0",
|
||||||
|
"cmii-uav-alarm:5.2.0",
|
||||||
|
"cmii-uav-autowaypoint:4.1.6-cm-0828",
|
||||||
|
"cmii-uav-brain:5.2.0",
|
||||||
|
"cmii-uav-cloud-live:5.2.0",
|
||||||
|
"cmii-uav-clusters:5.2.0",
|
||||||
|
"cmii-uav-cms:5.2.0",
|
||||||
|
"cmii-uav-data-post-process:5.2.0",
|
||||||
|
"cmii-uav-depotautoreturn:4.2.0",
|
||||||
|
"cmii-uav-developer:5.2.0-25858",
|
||||||
|
"cmii-uav-device:5.2.0",
|
||||||
|
"cmii-uav-emergency:5.2.0",
|
||||||
|
"cmii-uav-gateway:5.2.0",
|
||||||
|
"cmii-uav-gis-server:5.2.0",
|
||||||
|
"cmii-uav-grid-datasource:5.2.0-24810",
|
||||||
|
"cmii-uav-grid-engine:5.1.0",
|
||||||
|
"cmii-uav-grid-manage:5.1.0",
|
||||||
|
"cmii-uav-industrial-portfolio:5.2.0-25268-12",
|
||||||
|
"cmii-uav-integration:5.2.0-25447",
|
||||||
|
"cmii-uav-kpi-monitor:5.2.0",
|
||||||
|
"cmii-uav-logger:5.2.0",
|
||||||
|
"cmii-uav-material-warehouse:5.2.0",
|
||||||
|
"cmii-uav-mission:5.2.0-25840",
|
||||||
|
"cmii-uav-mqtthandler:5.2.0-25340-1",
|
||||||
|
"cmii-uav-notice:5.2.0",
|
||||||
|
"cmii-uav-oauth:5.2.0",
|
||||||
|
"cmii-uav-process:5.2.0",
|
||||||
|
"cmii-uav-surveillance:5.2.0-21794",
|
||||||
|
"cmii-uav-threedsimulation:5.2.0",
|
||||||
|
"cmii-uav-tower:5.3.0",
|
||||||
|
"cmii-uav-user:5.2.0",
|
||||||
|
"cmii-uav-waypoint:5.2.0-011102",
|
||||||
|
"cmii-suav-platform-supervision:5.2.0",
|
||||||
|
"cmii-suav-platform-supervisionh5:5.2.0",
|
||||||
|
"cmii-uav-platform:5.2.0",
|
||||||
|
"cmii-uav-platform-ai-brain:5.2.0",
|
||||||
|
"cmii-uav-platform-armypeople:5.2.0-24538",
|
||||||
|
"cmii-uav-platform-base:5.2.0",
|
||||||
|
"cmii-uav-platform-cms-portal:5.2.0",
|
||||||
|
"cmii-uav-platform-detection:5.2.0",
|
||||||
|
"cmii-uav-platform-emergency-rescue:5.2.0",
|
||||||
|
"cmii-uav-platform-hljtt:5.2.0",
|
||||||
|
"cmii-uav-platform-jiangsuwenlv:4.1.3-jiangsu-0427",
|
||||||
|
"cmii-uav-platform-logistics:5.2.0",
|
||||||
|
"cmii-uav-platform-media:5.2.0",
|
||||||
|
"cmii-uav-platform-multiterminal:5.2.0",
|
||||||
|
"cmii-uav-platform-mws:5.2.0",
|
||||||
|
"cmii-uav-platform-oms:5.2.0",
|
||||||
|
"cmii-uav-platform-open:5.2.0",
|
||||||
|
"cmii-uav-platform-qingdao:4.1.6-24238-qingdao",
|
||||||
|
"cmii-uav-platform-qinghaitourism:4.1.0-21377-0508",
|
||||||
|
"cmii-uav-platform-security:4.1.6",
|
||||||
|
"cmii-uav-platform-securityh5:5.2.0",
|
||||||
|
"cmii-uav-platform-seniclive:5.2.0",
|
||||||
|
"cmii-uav-platform-share:5.2.0",
|
||||||
|
"cmii-uav-platform-splice:5.2.0",
|
||||||
|
"cmii-uav-platform-threedsimulation:5.2.0-21392",
|
||||||
|
"cmii-uav-platform-visualization:5.2.0",
|
||||||
|
}
|
||||||
|
|
||||||
var Cmii520DemoImageList = []string{
|
var Cmii520DemoImageList = []string{
|
||||||
"cmii-admin-data:5.2.0",
|
"cmii-admin-data:5.2.0",
|
||||||
"cmii-admin-gateway:5.2.0",
|
"cmii-admin-gateway:5.2.0",
|
||||||
|
|||||||
@@ -34,12 +34,15 @@ public class ProjectDeployContext {
|
|||||||
boolean cmiiHarborSynchronized;
|
boolean cmiiHarborSynchronized;
|
||||||
String currentSynchronizingProject;
|
String currentSynchronizingProject;
|
||||||
|
|
||||||
// app
|
|
||||||
List<BaseFunctionEnum> masterNodeProcedure;
|
|
||||||
|
|
||||||
List<BaseFunctionEnum> agentNodeProcedure;
|
List<BaseFunctionEnum> masterNodeBaseProcedure;
|
||||||
|
|
||||||
|
List<BaseFunctionEnum> agentNodeBaseProcedure;
|
||||||
|
|
||||||
ArrayList<String> baseFunctionArgs;
|
ArrayList<String> baseFunctionArgs;
|
||||||
ArrayList<String> appFunctionArgs;
|
ArrayList<String> appFunctionArgs;
|
||||||
|
|
||||||
|
// app
|
||||||
|
List<AppFunctionEnum> masterAppProcedure;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import io.wdd.server.coreService.CoreProjectService;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -22,6 +23,24 @@ public class AppFuncScheduler {
|
|||||||
@Resource
|
@Resource
|
||||||
CoreProjectService coreProjectService;
|
CoreProjectService coreProjectService;
|
||||||
|
|
||||||
|
public boolean runProcedure(ProjectDeployContext projectDeployContext) {
|
||||||
|
|
||||||
|
// before run
|
||||||
|
// check base requirement
|
||||||
|
beforeRunProcedure(projectDeployContext);
|
||||||
|
|
||||||
|
|
||||||
|
// during run
|
||||||
|
doRunProcedure(projectDeployContext);
|
||||||
|
|
||||||
|
|
||||||
|
// after run
|
||||||
|
afterRunProcedure(projectDeployContext);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数固定顺序为 A1C2IP SUPREME N1C2IP A1C1IP A1C1JS M2D2IP KIMMY JACLOVE
|
* 参数固定顺序为 A1C2IP SUPREME N1C2IP A1C1IP A1C1JS M2D2IP KIMMY JACLOVE
|
||||||
* 1 2 3 4 5 6 7 8
|
* 1 2 3 4 5 6 7 8
|
||||||
@@ -55,36 +74,15 @@ public class AppFuncScheduler {
|
|||||||
return appFuncArgs;
|
return appFuncArgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean runProcedure(ProjectDeployContext projectDeployContext) {
|
private void beforeRunProcedure(ProjectDeployContext projectDeployContext) {
|
||||||
|
|
||||||
// before run
|
// 检查是否符合规定
|
||||||
// check base requirement
|
|
||||||
beforeRunProcedure(projectDeployContext);
|
|
||||||
|
|
||||||
|
// 检查每一个Agent是否能够连通,调用命令返回结果
|
||||||
|
|
||||||
// during run
|
// 打印施工信息
|
||||||
doRunProcedure(projectDeployContext);
|
|
||||||
|
|
||||||
|
|
||||||
// after run
|
|
||||||
afterRunProcedure(projectDeployContext);
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void afterRunProcedure(ProjectDeployContext projectDeployContext) {
|
|
||||||
|
|
||||||
// 检查是否安装完成, 对安装环境进行判定
|
|
||||||
log.debug("afterRunProcedure complete!");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doRunProcedure(ProjectDeployContext projectDeployContext) {
|
|
||||||
|
|
||||||
// 执行 基础功能施工的内容
|
// 执行 基础功能施工的内容
|
||||||
String masterTopicName = projectDeployContext
|
|
||||||
.getMasterNode()
|
|
||||||
.getTopicName();
|
|
||||||
|
|
||||||
ProjectInfoPO projectInfoPO = coreProjectService.projectGetOne(projectDeployContext.getProjectId());
|
ProjectInfoPO projectInfoPO = coreProjectService.projectGetOne(projectDeployContext.getProjectId());
|
||||||
if (ObjectUtils.isEmpty(projectInfoPO)) {
|
if (ObjectUtils.isEmpty(projectInfoPO)) {
|
||||||
@@ -99,29 +97,36 @@ public class AppFuncScheduler {
|
|||||||
projectInfoPO
|
projectInfoPO
|
||||||
);
|
);
|
||||||
|
|
||||||
List<AppFunctionEnum> appFunctionEnumList = List.of(
|
projectDeployContext.setAppFunctionArgs(appFuncArgs);
|
||||||
// AppFunctionEnum.DEPLOY_CHRONY_SERVER,
|
|
||||||
// AppFunctionEnum.DEPLOY_RKE
|
|
||||||
// AppFunctionEnum.DEPLOY_K8S_DASHBOARD,
|
|
||||||
// AppFunctionEnum.DEPLOY_NFS,
|
|
||||||
// AppFunctionEnum.DEPLOY_TEST_NFS,
|
|
||||||
// AppFunctionEnum.DEPLOY_K8S_NAMESPACE
|
|
||||||
// AppFunctionEnum.DEPLOY_K8S_PVC,
|
|
||||||
// AppFunctionEnum.DEPLOY_K8S_MYSQL,
|
|
||||||
// AppFunctionEnum.DEPLOY_K8S_REDIS,
|
|
||||||
// AppFunctionEnum.DEPLOY_K8S_MIDDLEWARES,
|
|
||||||
// AppFunctionEnum.DEPLOY_INGRESS
|
|
||||||
AppFunctionEnum.DEPLOY_FRONTEND
|
|
||||||
// AppFunctionEnum.DEPLOY_BACKEND
|
|
||||||
// AppFunctionEnum.DEPLOY_K8S_SRS
|
|
||||||
|
|
||||||
);
|
log.debug("beforeRunProcedure complete!");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
for (AppFunctionEnum appFunctionEnum : appFunctionEnumList) {
|
private void afterRunProcedure(ProjectDeployContext projectDeployContext) {
|
||||||
|
|
||||||
|
// 检查是否安装完成, 对安装环境进行判定
|
||||||
|
log.debug("afterRunProcedure complete!");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doRunProcedure(ProjectDeployContext projectDeployContext) {
|
||||||
|
|
||||||
|
String masterTopicName = projectDeployContext
|
||||||
|
.getMasterNode()
|
||||||
|
.getTopicName();
|
||||||
|
|
||||||
|
List<AppFunctionEnum> masterAppProcedure = projectDeployContext.getMasterAppProcedure();
|
||||||
|
if (CollectionUtils.isEmpty(masterAppProcedure)) {
|
||||||
|
log.info("app procedure is null !");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<String> appFunctionArgs = projectDeployContext.getAppFunctionArgs();
|
||||||
|
|
||||||
|
for (AppFunctionEnum appFunctionEnum : masterAppProcedure) {
|
||||||
|
|
||||||
// rebuild
|
// rebuild
|
||||||
appFuncArgs.add(
|
appFunctionArgs.add(
|
||||||
0,
|
0,
|
||||||
appFunctionEnum.getAppOpname()
|
appFunctionEnum.getAppOpname()
|
||||||
);
|
);
|
||||||
@@ -129,7 +134,7 @@ public class AppFuncScheduler {
|
|||||||
boolean appFuncJudge = funcService.callAppFuncAndJudge(
|
boolean appFuncJudge = funcService.callAppFuncAndJudge(
|
||||||
masterTopicName,
|
masterTopicName,
|
||||||
appFunctionEnum,
|
appFunctionEnum,
|
||||||
appFuncArgs
|
appFunctionArgs
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!appFuncJudge) {
|
if (!appFuncJudge) {
|
||||||
@@ -142,22 +147,10 @@ public class AppFuncScheduler {
|
|||||||
|
|
||||||
|
|
||||||
// must remove this one
|
// must remove this one
|
||||||
appFuncArgs.remove(0);
|
appFunctionArgs.remove(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void beforeRunProcedure(ProjectDeployContext projectDeployContext) {
|
|
||||||
|
|
||||||
// 检查是否符合规定
|
|
||||||
|
|
||||||
// 检查每一个Agent是否能够连通,调用命令返回结果
|
|
||||||
|
|
||||||
// 打印施工信息
|
|
||||||
|
|
||||||
log.debug("beforeRunProcedure complete!");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ public class BaseFuncScheduler {
|
|||||||
|
|
||||||
// base func args
|
// base func args
|
||||||
ArrayList<String> baseFuncArgList = new ArrayList<>();
|
ArrayList<String> baseFuncArgList = new ArrayList<>();
|
||||||
baseFuncArgList.add("20");
|
|
||||||
baseFuncArgList.add(projectDeployContext
|
baseFuncArgList.add(projectDeployContext
|
||||||
.getMasterNode()
|
.getMasterNode()
|
||||||
.getServerIpInV4());
|
.getServerIpInV4());
|
||||||
@@ -132,9 +131,9 @@ public class BaseFuncScheduler {
|
|||||||
|
|
||||||
List<BaseFunctionEnum> agentNodeProcedureList;
|
List<BaseFunctionEnum> agentNodeProcedureList;
|
||||||
if (masterNode) {
|
if (masterNode) {
|
||||||
agentNodeProcedureList = projectDeployContext.getMasterNodeProcedure();
|
agentNodeProcedureList = projectDeployContext.getMasterNodeBaseProcedure();
|
||||||
} else {
|
} else {
|
||||||
agentNodeProcedureList = projectDeployContext.getAgentNodeProcedure();
|
agentNodeProcedureList = projectDeployContext.getAgentNodeBaseProcedure();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(agentNodeProcedureList)) {
|
if (CollectionUtils.isEmpty(agentNodeProcedureList)) {
|
||||||
|
|||||||
@@ -184,7 +184,8 @@ public class HarborFuncScheduler {
|
|||||||
syncHarborArgList.add(masterNode.getServerIpInV4());
|
syncHarborArgList.add(masterNode.getServerIpInV4());
|
||||||
// second arg sourceHarborHost
|
// second arg sourceHarborHost
|
||||||
// String sourceHarborHost = getIPv4Address();
|
// String sourceHarborHost = getIPv4Address();
|
||||||
syncHarborArgList.add("harbor.wdd.io");
|
// syncHarborArgList.add("harbor.wdd.io"); // local
|
||||||
|
syncHarborArgList.add("192.168.0.6:8034"); // public
|
||||||
|
|
||||||
// third arg sync project name
|
// third arg sync project name
|
||||||
syncHarborArgList.add(projectDeployContext.getCurrentSynchronizingProject());
|
syncHarborArgList.add(projectDeployContext.getCurrentSynchronizingProject());
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ import java.util.concurrent.CountDownLatch;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static io.wdd.rpc.message.handler.OMessageHandler.*;
|
import static io.wdd.rpc.message.handler.OMessageHandler.StopWaitingResult;
|
||||||
|
import static io.wdd.rpc.message.handler.OMessageHandler.WaitFromAgent;
|
||||||
import static io.wdd.rpc.status.AllAgentStatusCache.ALL_AGENT_TOPIC_NAME_SET;
|
import static io.wdd.rpc.status.AllAgentStatusCache.ALL_AGENT_TOPIC_NAME_SET;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -66,14 +67,14 @@ public class ExecutionServiceImpl implements ExecutionService {
|
|||||||
oMessageToAgentSender.send(octopusMessage);
|
oMessageToAgentSender.send(octopusMessage);
|
||||||
|
|
||||||
// debug
|
// debug
|
||||||
log.debug(
|
// log.debug(
|
||||||
"发送的 matchKey为 {}, 内容为 {}",
|
// "发送的 matchKey为 {}, 内容为 {}",
|
||||||
GenerateOMessageMatchKey(
|
// GenerateOMessageMatchKey(
|
||||||
octopusMessage.getOctopusMessageType(),
|
// octopusMessage.getOctopusMessageType(),
|
||||||
octopusMessage.getInit_time()
|
// octopusMessage.getInit_time()
|
||||||
),
|
// ),
|
||||||
octopusMessage
|
// octopusMessage
|
||||||
);
|
// );
|
||||||
|
|
||||||
// 需要返回结果
|
// 需要返回结果
|
||||||
|
|
||||||
@@ -116,25 +117,25 @@ public class ExecutionServiceImpl implements ExecutionService {
|
|||||||
commandResultLog = (ArrayList<String>) octopusMessage.getResult();
|
commandResultLog = (ArrayList<String>) octopusMessage.getResult();
|
||||||
|
|
||||||
|
|
||||||
Object executionContent;
|
// Object executionContent;
|
||||||
if (executionMessage
|
// if (executionMessage
|
||||||
.getExecutionType()
|
// .getExecutionType()
|
||||||
.equals("BASE")) {
|
// .equals("BASE")) {
|
||||||
executionContent = executionMessage.getExecutionType() + "==" + executionMessage.getFuncContent();
|
// executionContent = executionMessage.getExecutionType() + "==" + executionMessage.getFuncContent();
|
||||||
} else if (executionMessage.getSingleLineCommand() != null) {
|
// } else if (executionMessage.getSingleLineCommand() != null) {
|
||||||
executionContent = executionMessage.getSingleLineCommand();
|
// executionContent = executionMessage.getSingleLineCommand();
|
||||||
} else {
|
// } else {
|
||||||
executionContent = executionMessage.getMultiLineCommand();
|
// executionContent = executionMessage.getMultiLineCommand();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// debug
|
// // debug
|
||||||
log.debug(
|
// log.debug(
|
||||||
"执行命令 {} {} 在规定时间内结束, 结果为 {} 返回内容为 {}",
|
// "执行命令 {} {} 在规定时间内结束, 结果为 {} 返回内容为 {}",
|
||||||
executionContent,
|
// executionContent,
|
||||||
waitOK ? "已经" : "未",
|
// waitOK ? "已经" : "未",
|
||||||
octopusMessage.getResultCode(),
|
// octopusMessage.getResultCode(),
|
||||||
commandResultLog
|
// commandResultLog
|
||||||
);
|
// );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.wdd.server.func;
|
package io.wdd.server.func;
|
||||||
|
|
||||||
|
import io.wdd.func.auto.beans.AppFunctionEnum;
|
||||||
import io.wdd.func.auto.beans.BaseFunctionEnum;
|
import io.wdd.func.auto.beans.BaseFunctionEnum;
|
||||||
import io.wdd.func.auto.beans.ProjectDeployContext;
|
import io.wdd.func.auto.beans.ProjectDeployContext;
|
||||||
import io.wdd.func.auto.service.AppFuncScheduler;
|
import io.wdd.func.auto.service.AppFuncScheduler;
|
||||||
@@ -93,28 +94,60 @@ public class TestBaseFuncScheduler {
|
|||||||
|
|
||||||
List<BaseFunctionEnum> masterNodeProcedure = List.of(
|
List<BaseFunctionEnum> masterNodeProcedure = List.of(
|
||||||
// BaseFunctionEnum.INSTALL_DOCKER,
|
// BaseFunctionEnum.INSTALL_DOCKER,
|
||||||
BaseFunctionEnum.INSTALL_DOCKER_COMPOSE,
|
// BaseFunctionEnum.INSTALL_DOCKER_COMPOSE,
|
||||||
BaseFunctionEnum.MODIFY_DOCKER_CONFIG,
|
// BaseFunctionEnum.MODIFY_DOCKER_CONFIG,
|
||||||
BaseFunctionEnum.INSTALL_HARBOR
|
// BaseFunctionEnum.INSTALL_HARBOR
|
||||||
|
// BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY
|
||||||
|
BaseFunctionEnum.INSTALL_NFS_SERVER_ONLINE
|
||||||
);
|
);
|
||||||
|
|
||||||
List<BaseFunctionEnum> agentNodeProcedure = List.of(
|
List<BaseFunctionEnum> agentNodeProcedure = List.of(
|
||||||
BaseFunctionEnum.DISABLE_SWAP,
|
// BaseFunctionEnum.DISABLE_SWAP,
|
||||||
BaseFunctionEnum.SHUTDOWN_FIREWALL,
|
// BaseFunctionEnum.SHUTDOWN_FIREWALL,
|
||||||
BaseFunctionEnum.INSTALL_DOCKER,
|
// BaseFunctionEnum.INSTALL_DOCKER,
|
||||||
BaseFunctionEnum.INSTALL_DOCKER_COMPOSE
|
// BaseFunctionEnum.INSTALL_DOCKER_COMPOSE
|
||||||
// BaseFunctionEnum.MODIFY_DOCKER_CONFIG
|
// BaseFunctionEnum.MODIFY_DOCKER_CONFIG
|
||||||
|
BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY
|
||||||
);
|
);
|
||||||
|
|
||||||
projectDeployContext.setAgentNodeProcedure(agentNodeProcedure);
|
projectDeployContext.setMasterNodeBaseProcedure(masterNodeProcedure);
|
||||||
|
projectDeployContext.setAgentNodeBaseProcedure(agentNodeProcedure);
|
||||||
|
|
||||||
|
// baseFuncScheduler.runProcedure(projectDeployContext);
|
||||||
baseFuncScheduler.runProcedure(projectDeployContext);
|
|
||||||
|
|
||||||
|
|
||||||
// harborFuncScheduler.runProcedure(projectDeployContext);
|
// harborFuncScheduler.runProcedure(projectDeployContext);
|
||||||
|
|
||||||
// appFuncScheduler.runProcedure(projectDeployContext);
|
|
||||||
|
List<AppFunctionEnum> appFunctionEnumList = List.of(
|
||||||
|
// AppFunctionEnum.DEPLOY_CHRONY_SERVER,
|
||||||
|
// AppFunctionEnum.DEPLOY_RKE
|
||||||
|
AppFunctionEnum.DEPLOY_K8S_DASHBOARD,
|
||||||
|
AppFunctionEnum.DEPLOY_NFS,
|
||||||
|
AppFunctionEnum.DEPLOY_TEST_NFS,
|
||||||
|
AppFunctionEnum.DEPLOY_K8S_NAMESPACE,
|
||||||
|
AppFunctionEnum.DEPLOY_K8S_PVC,
|
||||||
|
AppFunctionEnum.DEPLOY_K8S_MYSQL,
|
||||||
|
AppFunctionEnum.DEPLOY_K8S_REDIS,
|
||||||
|
AppFunctionEnum.DEPLOY_K8S_MIDDLEWARES,
|
||||||
|
AppFunctionEnum.DEPLOY_INGRESS
|
||||||
|
// AppFunctionEnum.DEPLOY_FRONTEND
|
||||||
|
// AppFunctionEnum.DEPLOY_BACKEND
|
||||||
|
// AppFunctionEnum.DEPLOY_K8S_SRS
|
||||||
|
|
||||||
|
);
|
||||||
|
projectDeployContext.setMasterAppProcedure(appFunctionEnumList);
|
||||||
|
|
||||||
|
appFuncScheduler.runProcedure(projectDeployContext);
|
||||||
|
|
||||||
|
|
||||||
|
masterNodeProcedure = List.of(BaseFunctionEnum.CHRONY_TO_MASTER);
|
||||||
|
agentNodeProcedure = List.of(BaseFunctionEnum.CHRONY_TO_MASTER);
|
||||||
|
|
||||||
|
projectDeployContext.setMasterNodeBaseProcedure(masterNodeProcedure);
|
||||||
|
projectDeployContext.setAgentNodeBaseProcedure(agentNodeProcedure);
|
||||||
|
|
||||||
|
// baseFuncScheduler.runProcedure(projectDeployContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user