[ Server ] [ Harbor ] - accomplish harbor create function | local oss url config
This commit is contained in:
@@ -30,7 +30,7 @@ func Execute(em *ExecutionMessage) (bool, []string) {
|
|||||||
var resultLog []string
|
var resultLog []string
|
||||||
var err error
|
var err error
|
||||||
ok := true
|
ok := true
|
||||||
executionContent := em.ExecutionType + "==" + strings.Join(em.FuncContent, "")
|
executionContent := em.ExecutionType + "==" + strings.Join(em.FuncContent, " - ")
|
||||||
|
|
||||||
log.DebugF("em message is => %#v", em)
|
log.DebugF("em message is => %#v", em)
|
||||||
|
|
||||||
|
|||||||
@@ -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://10.250.0.65:9000/octopus/"
|
ossOfflinePrefix: "http://10.250.0.100:9000/octopus/"
|
||||||
status:
|
status:
|
||||||
app:
|
app:
|
||||||
- Nginx/nginx
|
- Nginx/nginx
|
||||||
|
|||||||
42
agent-go/tmp/Exsi-copy-virtual-host.sh
Normal file
42
agent-go/tmp/Exsi-copy-virtual-host.sh
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SourcePath=/vmfs/volumes/HardDrive
|
||||||
|
DestinationPath=/vmfs/volumes/datastore2
|
||||||
|
|
||||||
|
|
||||||
|
main() {
|
||||||
|
check_input "$@"
|
||||||
|
# 继续执行其他操作
|
||||||
|
echo "输入参数数量为1个,继续执行脚本..."
|
||||||
|
|
||||||
|
local vmHostname="test-$1"
|
||||||
|
|
||||||
|
echo "准备创建 的虚拟机名称为 => ${vmHostname}"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "开始创建虚拟机目录!"
|
||||||
|
mkdir -p "$SourcePath/$vmHostname"
|
||||||
|
|
||||||
|
echo "开始复制虚拟磁盘 $SourcePath/ubuntu-template => $DestinationPath/$vmHostname"
|
||||||
|
cp "$SourcePath/ubuntu-template/ubuntu-200406-aliyun-pure.mf" "$DestinationPath/$vmHostname/$vmHostname.mf"
|
||||||
|
cp "$SourcePath/ubuntu-template/ubuntu-200406-aliyun-pure.ovf" "$DestinationPath/$vmHostname/$vmHostname.ovf"
|
||||||
|
echo ""
|
||||||
|
echo "开始复制 $SourcePath/ubuntu-template/ubuntu-200406-aliyun-pure-1.vmdk ..."
|
||||||
|
cp "$SourcePath/ubuntu-template/ubuntu-200406-aliyun-pure-1.vmdk" "$DestinationPath/$vmHostname/$vmHostname.vmdk"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "复制完成!"
|
||||||
|
|
||||||
|
echo "检查复制结果 ↓↓↓↓↓↓"
|
||||||
|
ls "$SourcePath/$vmHostname"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
check_input() {
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "输入参数数量必须为1个"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
@@ -41,7 +41,7 @@ public enum BaseFunctionEnum {
|
|||||||
|
|
||||||
INSTALL_HARBOR(
|
INSTALL_HARBOR(
|
||||||
"installHarbor",
|
"installHarbor",
|
||||||
"安装Harbor, 默认为2.1.0版本"
|
"安装Harbor, 默认为2.9.0版本"
|
||||||
),
|
),
|
||||||
|
|
||||||
INSTALL_CHRONY(
|
INSTALL_CHRONY(
|
||||||
|
|||||||
@@ -86,15 +86,13 @@ public class BaseFuncScheduler {
|
|||||||
private boolean MasterNodeBaseProcedure(String masterTopicName) {
|
private boolean MasterNodeBaseProcedure(String masterTopicName) {
|
||||||
|
|
||||||
List<BaseFunctionEnum> masterNodeProcedureList = List.of(
|
List<BaseFunctionEnum> masterNodeProcedureList = List.of(
|
||||||
// Object.DISABLE_SWAP,
|
// BaseFunctionEnum.DISABLE_SWAP,
|
||||||
// Object.SHUTDOWN_FIREWALL,
|
// BaseFunctionEnum.SHUTDOWN_FIREWALL,
|
||||||
// Object.INSTALL_CHRONY,
|
// BaseFunctionEnum.INSTALL_CHRONY,
|
||||||
// Object.CHRONY_TO_PUBLIC_NTP,
|
// BaseFunctionEnum.CHRONY_TO_PUBLIC_NTP,
|
||||||
// Object.INSTALL_DEFAULT_SSH_KEY,
|
// BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY,
|
||||||
// Object.INSTALL_DOCKER,
|
// BaseFunctionEnum.INSTALL_HARBOR,
|
||||||
// Object.INSTALL_DOCKER_COMPOSE
|
// BaseFunctionEnum.INSTALL_ZSH
|
||||||
// Object.INSTALL_HARBOR,
|
|
||||||
// Object.INSTALL_ZSH
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -115,16 +113,28 @@ public class BaseFuncScheduler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<BaseFunctionEnum> masterNodeDurationTaskList = List.of(
|
||||||
|
// BaseFunctionEnum.INSTALL_DOCKER,
|
||||||
|
BaseFunctionEnum.INSTALL_DOCKER_COMPOSE,
|
||||||
|
BaseFunctionEnum.INSTALL_HARBOR
|
||||||
|
);
|
||||||
|
|
||||||
|
for (BaseFunctionEnum durationBaseFunc : masterNodeDurationTaskList) {
|
||||||
if (!funcService.callBaseFuncAndJudge(
|
if (!funcService.callBaseFuncAndJudge(
|
||||||
masterTopicName,
|
masterTopicName,
|
||||||
BaseFunctionEnum.INSTALL_HARBOR,
|
durationBaseFunc,
|
||||||
null,
|
null,
|
||||||
true
|
true
|
||||||
)) {
|
)) {
|
||||||
log.error("Master Install Harbor Failed !");
|
log.error(
|
||||||
|
"Master Duration Task Failed ! => {}",
|
||||||
|
durationBaseFunc
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class ExecutionServiceImpl implements ExecutionService {
|
|||||||
|
|
||||||
private static final String MANUAL_COMMAND_TYPE = "manual-command";
|
private static final String MANUAL_COMMAND_TYPE = "manual-command";
|
||||||
|
|
||||||
private static final int COMMAND_MAX_WAIT_TIMEOUT = 60;
|
private static final int COMMAND_MAX_WAIT_TIMEOUT = 120;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
OMessageToAgentSender oMessageToAgentSender;
|
OMessageToAgentSender oMessageToAgentSender;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class TestBaseFuncScheduler {
|
|||||||
|
|
||||||
|
|
||||||
ServerQueryEntity serverQueryEntity = new ServerQueryEntity();
|
ServerQueryEntity serverQueryEntity = new ServerQueryEntity();
|
||||||
serverQueryEntity.setServerName("Chengdu");
|
serverQueryEntity.setServerName("Chengdu-amd64-99");
|
||||||
ServerInfoPO serverInfoPO = serverService
|
ServerInfoPO serverInfoPO = serverService
|
||||||
.serverGetByPage(serverQueryEntity)
|
.serverGetByPage(serverQueryEntity)
|
||||||
.getRecords()
|
.getRecords()
|
||||||
|
|||||||
Reference in New Issue
Block a user