[agent-deploy] - cmii new app deploy

This commit is contained in:
zeaslity
2024-07-17 10:56:44 +08:00
parent 408bb9b83f
commit 809a67ccc2
5 changed files with 29 additions and 17 deletions

View File

@@ -859,18 +859,16 @@ func (op *AgentOsOperator) installDockerExec(args []string) (bool, []string) {
"20",
}
}
// todo ubuntu 22.04
// ubuntu 内部
//var specificDockerVersion string
// hard code here 5:20.10.10~3-0~ubuntu-focal
//if strings.HasPrefix(args[0], "19") {
// specificDockerVersion = "5:19.03.15~3-0~ubuntu-" + op.AgentOSReleaseCode
//} else {
//
//}
// 20.04 default
specificDockerVersion := "5:20.10.20~3-0~ubuntu-" + op.AgentOSReleaseCode
// apt-cache madison docker-ce | grep 20.10.20 | awk '{print$3}'
specificDockerVersion := "5:20.10.10~3-0~ubuntu-" + op.AgentOSReleaseCode
// get by method
ok, log4 := HardCodeCommandExecutor("apt-cache madison docker-ce | grep 20.10.20 | awk '{print$3}'")
if ok {
specificDockerVersion = strings.TrimSpace(log4[0])
}
log.InfoF("需要安装的docker版本为 => %s", specificDockerVersion)

View File

@@ -40,7 +40,6 @@ var agentOP = &AgentOsOperator{
Comment: "",
MachineID: "",
AgentVersion: "",
TopicName: "",
},
OssOfflinePrefix: "http://10.250.0.100:9000/octopus/",
}

View File

@@ -175,6 +175,21 @@ func TestPipelineCommandExecutor2(t *testing.T) {
// Add more test cases as needed...
}
func TestHardCodeCommandExecutor(t *testing.T) {
// 20.04 default
specificDockerVersion := "5:20.10.20~3-0~ubuntu-focal"
// apt-cache madison docker-ce | grep 20.10.20 | awk '{print$3}'
// get by method
ok, log4 := HardCodeCommandExecutor("apt-cache madison docker-ce | grep 20.10.20 | awk '{print$3}'")
if ok {
specificDockerVersion = strings.TrimSpace(log4[0])
}
fmt.Println(specificDockerVersion)
}
func TestSimple(t *testing.T) {
for i := 0; i < 10; i++ {

View File

@@ -9,7 +9,7 @@ spring:
allow-circular-references: true
allow-bean-definition-overriding: true
rabbitmq:
host: 42.192.52.227
host: 10.250.0.100
port: 20672
username: boge
password: boge8tingH
@@ -24,7 +24,7 @@ spring:
max-interval: 65000
initial-interval: 2000
redis:
host: 42.192.52.227
host: 10.250.0.100
port: 21370
database: 0
password: boge8tingH
@@ -46,7 +46,7 @@ spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://42.192.52.227:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
url: jdbc:mysql://10.250.0.100:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: boge
password: boge8tingH
type: com.zaxxer.hikari.HikariDataSource

View File

@@ -66,7 +66,7 @@ public class TestBaseFuncScheduler {
// String masterNodeServerName = "Chengdu-amd64-10"; // 北京通感
// String masterNodeServerName = "Chengdu-amd64-14"; // 新疆移动
// String masterNodeServerName = "Local-amd64-251"; // 新疆移动
String masterNodeServerName = "Chengdu-amd64-110"; // 北京通感
String masterNodeServerName = "Chengdu-amd64-200"; // 北京通感
// String masterNodeServerName = "Ziyang-amd64-61"; // 资阳公安
ProjectServerVO projectServerVO = coreProjectServerService.projectServerOne(projectServerId);
@@ -126,7 +126,7 @@ public class TestBaseFuncScheduler {
throw new RuntimeException(e);
}
// baseFuncScheduler.runProcedure(projectDeployContext);
baseFuncScheduler.runProcedure(projectDeployContext);
// 只能支持 带端口的HarborHost 默认为8033Chengdu-amd64-110
// harborFuncScheduler.runProcedure(projectDeployContext);
@@ -154,7 +154,7 @@ public class TestBaseFuncScheduler {
);
projectDeployContext.setMasterAppProcedure(appFunctionEnumList);
appFuncScheduler.runProcedure(projectDeployContext);
// appFuncScheduler.runProcedure(projectDeployContext);
masterNodeProcedure = List.of(BaseFunctionEnum.CHRONY_TO_MASTER);