[ Server ] [ Harbor ] - accomplish harbor create function | local oss url config

This commit is contained in:
zeaslity
2023-11-14 14:07:00 +08:00
parent ccffd8eea2
commit 2b3a503a5a
7 changed files with 74 additions and 22 deletions

View File

@@ -30,7 +30,7 @@ func Execute(em *ExecutionMessage) (bool, []string) {
var resultLog []string
var err error
ok := true
executionContent := em.ExecutionType + "==" + strings.Join(em.FuncContent, "")
executionContent := em.ExecutionType + "==" + strings.Join(em.FuncContent, " - ")
log.DebugF("em message is => %#v", em)

View File

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

View 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 "$@"