[ Agent ] [ App ] - offline build nfs server

This commit is contained in:
zeaslity
2023-12-14 16:36:24 +08:00
parent 889185f577
commit 9fca83c737
8 changed files with 37 additions and 22 deletions

View File

@@ -1202,6 +1202,13 @@ func (op *AgentOsOperator) installNfsServerOnlineExec() (bool, []string) {
func (op *AgentOsOperator) installNFSServerOfflineExec() (bool, []string) { func (op *AgentOsOperator) installNFSServerOfflineExec() (bool, []string) {
log.InfoF("[installNFSServerOfflineExec] - start to install nfs server offline !")
if !BasicCreateFolder("/root/install") {
return false, []string{
"[installNFSServerOfflineExec] - create install folder error !",
}
}
// check for version // check for version
executor, i := HardCodeCommandExecutor("grep PRETTY_NAME /etc/os-release | cut -d= -f2 | tr -d '\"' | sed 's/ /-/g'") executor, i := HardCodeCommandExecutor("grep PRETTY_NAME /etc/os-release | cut -d= -f2 | tr -d '\"' | sed 's/ /-/g'")
if !executor { if !executor {

View File

@@ -38,7 +38,7 @@ octopus:
# agent执行一条Command的最长超时时间 # agent执行一条Command的最长超时时间
processMaxTimeOut: 60 processMaxTimeOut: 60
# ossOfflinePrefix: "https://oss-s1.107421.xyz" # ossOfflinePrefix: "https://oss-s1.107421.xyz"
ossOfflinePrefix: "http://OFFLINE_HOST_IP9000/octopus/" ossOfflinePrefix: "http://OFFLINE_HOST_IP:9000/octopus/"
status: status:
app: app:
- Nginx/nginx - Nginx/nginx

View File

@@ -27,7 +27,7 @@
</modules> </modules>
<properties> <properties>
<java.version>17</java.version> <java.version>11</java.version>
<spring-shell.version>2.1.3</spring-shell.version> <spring-shell.version>2.1.3</spring-shell.version>
<spring-boot-admin.version>2.7.4</spring-boot-admin.version> <spring-boot-admin.version>2.7.4</spring-boot-admin.version>
<spring-cloud.version>Hoxton.SR12</spring-cloud.version> <spring-cloud.version>Hoxton.SR12</spring-cloud.version>

View File

@@ -15,7 +15,7 @@
<description>server</description> <description>server</description>
<properties> <properties>
<java.version>17</java.version> <java.version>11</java.version>
</properties> </properties>
<dependencies> <dependencies>

View File

@@ -43,10 +43,7 @@ public enum BaseFunctionEnum {
"修改docker daemon config, 参数为 Harbor服务器的IP" "修改docker daemon config, 参数为 Harbor服务器的IP"
), ),
INSTALL_HARBOR(
"installHarbor",
"安装Harbor, 默认为2.9.0版本"
),
INSTALL_NFS_ONLINE( INSTALL_NFS_ONLINE(
"installNfsOnline", "installNfsOnline",
@@ -58,12 +55,12 @@ public enum BaseFunctionEnum {
"安装nfs-server online" "安装nfs-server online"
), ),
INSTALL_CHRONY( INSTALL_CHRONY_DISCARD(
"installChrony", "installChrony",
"安装Chrony服务器" "安装Chrony服务器, 废弃"
), ),
CHRONY_TO_PUBLIC_NTP( CHRONY_TO_PUBLIC_NTP_DISCARD(
"chronyToPublicNTP", "chronyToPublicNTP",
"时间同步至公网NTP服务器" "时间同步至公网NTP服务器"
), ),
@@ -73,6 +70,11 @@ public enum BaseFunctionEnum {
"安装配置ZSH" "安装配置ZSH"
), ),
INSTALL_HARBOR(
"installHarbor",
"安装Harbor, 默认为2.9.0版本"
),
CHRONY_TO_MASTER( CHRONY_TO_MASTER(
"chronyToMaster", "chronyToMaster",
"时间同步至Master, args为 Master节点IP" "时间同步至Master, args为 Master节点IP"

View File

@@ -97,13 +97,8 @@ public class BaseFuncScheduler {
List<BaseFunctionEnum> masterNodeProcedureList = List.of( List<BaseFunctionEnum> masterNodeProcedureList = List.of(
BaseFunctionEnum.DISABLE_SWAP, BaseFunctionEnum.DISABLE_SWAP,
BaseFunctionEnum.SHUTDOWN_FIREWALL, BaseFunctionEnum.SHUTDOWN_FIREWALL,
BaseFunctionEnum.INSTALL_CHRONY, BaseFunctionEnum.CHRONY_TO_MASTER,
BaseFunctionEnum.CHRONY_TO_PUBLIC_NTP, BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY
BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY,
BaseFunctionEnum.MODIFY_DOCKER_CONFIG
// BaseFunctionEnum.INSTALL_HARBOR,
// BaseFunctionEnum.INSTALL_ZSH
); );
@@ -129,12 +124,18 @@ public class BaseFuncScheduler {
return false; return false;
} }
// remove first args
baseFuncArgList.remove(0);
} }
List<BaseFunctionEnum> masterNodeDurationTaskList = List.of( List<BaseFunctionEnum> masterNodeDurationTaskList = List.of(
BaseFunctionEnum.INSTALL_NFS_SERVER_ONLINE, BaseFunctionEnum.INSTALL_NFS_SERVER_ONLINE,
BaseFunctionEnum.INSTALL_DOCKER, BaseFunctionEnum.INSTALL_DOCKER,
BaseFunctionEnum.INSTALL_DOCKER_COMPOSE, BaseFunctionEnum.INSTALL_DOCKER_COMPOSE,
BaseFunctionEnum.MODIFY_DOCKER_CONFIG,
BaseFunctionEnum.INSTALL_HARBOR BaseFunctionEnum.INSTALL_HARBOR
); );
@@ -158,6 +159,9 @@ public class BaseFuncScheduler {
); );
return false; return false;
} }
// remove
baseFuncArgList.remove(0);
} }
return true; return true;

View File

@@ -1,12 +1,14 @@
server: server:
port: 9999 port: 9999
# shanghai 10.250.0.100
# local 10.250.0.100
spring: spring:
main: main:
allow-circular-references: true allow-circular-references: true
allow-bean-definition-overriding: true allow-bean-definition-overriding: true
rabbitmq: rabbitmq:
host: 42.192.52.227 host: 10.250.0.100
port: 20672 port: 20672
username: boge username: boge
password: boge8tingH password: boge8tingH
@@ -21,7 +23,7 @@ spring:
max-interval: 65000 max-interval: 65000
initial-interval: 65000 initial-interval: 65000
redis: redis:
host: 42.192.52.227 host: 10.250.0.100
port: 21370 port: 21370
database: 0 database: 0
password: boge8tingH password: boge8tingH
@@ -52,7 +54,7 @@ spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver 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 username: boge
password: boge8tingH password: boge8tingH
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource

View File

@@ -53,11 +53,11 @@ public class TestBaseFuncScheduler {
projectDeployContext.setMasterNode(serverInfoPO); projectDeployContext.setMasterNode(serverInfoPO);
// baseFuncScheduler.runProcedure(projectDeployContext); baseFuncScheduler.runProcedure(projectDeployContext);
// harborFuncScheduler.runProcedure(projectDeployContext); // harborFuncScheduler.runProcedure(projectDeployContext);
appFuncScheduler.runProcedure(projectDeployContext); // appFuncScheduler.runProcedure(projectDeployContext);
} }
} }