新增浙江二级平台的内容
This commit is contained in:
@@ -7,6 +7,9 @@ https://oss.demo.uavcmlc.com/cmlc-installation/downloadfile/amd/harbor-offline-i
|
||||
|
||||
https://oss.demo.uavcmlc.com/cmlc-installation/downloadfile/amd/docker-compose-linux-x86_64-v2.18.0
|
||||
|
||||
mc.exe get uav-demo/cmlc-installation/downloadfile/amd/docker-amd64-20.10.15.tgz "D:\CmiiDeployOffline\"
|
||||
mc.exe get uav-demo/cmlc-installation/downloadfile/amd/docker-compose-linux-x86_64-v2.18.0 "D:\CmiiDeployOffline\"
|
||||
|
||||
|
||||
mv /root/octopus-agent_linux_amd64 /usr/local/bin/octopus-agent
|
||||
chmod +x /usr/local/bin/octopus-agent
|
||||
|
||||
@@ -39,3 +39,11 @@ scp /etc/docker/daemon.json root@${server}:/etc/docker/
|
||||
ssh root@${server} "systemctl restart docker && sleep 3 && docker info"
|
||||
|
||||
sed -i '/^$/d' ~/.ssh/*
|
||||
|
||||
chmod +x /usr/local/bin/octopus-agent
|
||||
printf 'firewall\n' | octopus-agent --mode=bastion
|
||||
printf 'sysconfig\n' | octopus-agent --mode=bastion
|
||||
printf 'swap\n' | octopus-agent --mode=bastion
|
||||
printf 'selinux\n' | octopus-agent --mode=bastion
|
||||
printf 'docker\n' | octopus-agent --mode=bastion
|
||||
printf 'dockercompose\n' | octopus-agent --mode=bastion
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
namespace=sdejpt
|
||||
namespace=zjyd
|
||||
|
||||
install_yq() {
|
||||
wget https://oss.demo.uavcmlc.com/cmlc-installation/downloadfile/amd/yq_linux_amd64 -O /usr/local/bin/yq
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
all_image_list_txt="all-cmii-image-list.txt" # 需要修改版本
|
||||
gzip_image_list_txt="all-gzip-image-list.txt" # 一般不需要修改
|
||||
oss_prefix_url="https://oss.demo.uavcmlc.com/cmlc-installation"
|
||||
local_gzip_path="/root/octopus_image"
|
||||
local_gzip_path="/root/octopus-image"
|
||||
|
||||
DockerRegisterDomain="harbor.wdd.io:8033" # 需要根据实际修改
|
||||
DockerRegisterDomain="192.168.10.3:8033" # 需要根据实际修改
|
||||
HarborAdminPass=V2ryStr@ngPss # 需要跟第一脚本中的密码保持一致
|
||||
|
||||
print_green() {
|
||||
@@ -116,9 +116,9 @@ Load_Tag_Upload(){
|
||||
shift # past argument
|
||||
;;
|
||||
cmii)
|
||||
local_gzip_path="$local_gzip_path/cmii"
|
||||
local_gzip_path="$local_gzip_path/6.1.1"
|
||||
mkdir -p $local_gzip_path
|
||||
oss_prefix_url="$oss_prefix_url/ehejpt/"
|
||||
oss_prefix_url="$oss_prefix_url/6.1.1/"
|
||||
ltu
|
||||
shift # past argument
|
||||
;;
|
||||
@@ -163,6 +163,6 @@ test(){
|
||||
}
|
||||
|
||||
# test
|
||||
Download_Load_Tag_Upload "rke"
|
||||
#Download_Load_Tag_Upload "rke"
|
||||
|
||||
#Load_Tag_Upload "rke"
|
||||
Load_Tag_Upload "cmii"
|
||||
12
998-常用脚本/镜像同步/imageSyncDLTU.ps1
Normal file
12
998-常用脚本/镜像同步/imageSyncDLTU.ps1
Normal file
@@ -0,0 +1,12 @@
|
||||
#mc.exe alias set uav-demo https://oss.demo.uavcmlc.com cmii B#923fC7mk
|
||||
|
||||
|
||||
mc.exe ls uav-demo/cmlc-installation/6.1.1/ | ForEach-Object {
|
||||
$item=($_.Split()[-1])
|
||||
Write-Host "start to download $item "
|
||||
mc.exe get uav-demo/cmlc-installation/6.1.1/$item "D:\CmiiDeployOffline\ZheJiangErJiPingTai\"
|
||||
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,69 @@
|
||||
function DownloadFileInChunks {
|
||||
param (
|
||||
[string]$url,
|
||||
[string]$destinationFile,
|
||||
[int]$chunkSizeGB = 1
|
||||
)
|
||||
|
||||
# 将 GB 转换为字节
|
||||
$chunkSize = $chunkSizeGB * 1024 * 1024 * 1024
|
||||
|
||||
# 获取文件的总大小
|
||||
$response = Invoke-WebRequest -Uri $url -Method Head
|
||||
$totalSize = [long]$response.Headers["Content-Length"]
|
||||
|
||||
# 计算分段数量
|
||||
$chunks = [math]::Ceiling($totalSize / $chunkSize)
|
||||
|
||||
# 下载每一段
|
||||
for ($i = 0; $i -lt $chunks; $i++) {
|
||||
$start = $i * $chunkSize
|
||||
$end = [math]::Min($start + $chunkSize - 1, $totalSize - 1)
|
||||
|
||||
$headers = @{
|
||||
"Range" = "bytes=$start-$end"
|
||||
}
|
||||
|
||||
$chunkResponse = Invoke-WebRequest -Uri $url -Headers $headers -Method Get
|
||||
$chunkData = $chunkResponse.Content
|
||||
|
||||
# 以追加模式写入文件
|
||||
[System.IO.File]::WriteAllBytes($destinationFile, $chunkData)
|
||||
}
|
||||
|
||||
Write-Host "dowonload ok"
|
||||
}
|
||||
|
||||
# 指定文件路径
|
||||
$filePath = "D:\CmiiDeployOffline\ZheJiangErJiPingTai\all-gzip-image-list.txt"
|
||||
# 指定下载的目标目录
|
||||
$destinationFolder = "D:\CmiiDeployOffline\ZheJiangErJiPingTai"
|
||||
|
||||
$oss_prefix_url="https://oss.demo.uavcmlc.com/cmlc-installation/6.1.1/"
|
||||
|
||||
# 创建目标目录(如果不存在)
|
||||
if (-not (Test-Path $destinationFolder)) {
|
||||
New-Item -ItemType Directory -Path $destinationFolder
|
||||
}
|
||||
#if (-not (Test-Path $destinationFolder)) {
|
||||
# New-Item -ItemType Directory -Path $destinationFolder
|
||||
#}
|
||||
|
||||
#Write-Host "[DLTU] - 开始下载镜像压缩文件"
|
||||
Write-Host ""
|
||||
|
||||
# 读取文件并下载每一行的 URL
|
||||
Get-Content $filePath | ForEach-Object {
|
||||
$url = $_
|
||||
Write-Output $url
|
||||
# $fileName = Join-Path $destinationFolder (Split-Path $url -Leaf)
|
||||
# Invoke-WebRequest -Uri $url -OutFile $fileName
|
||||
Write-Host "start to download $oss_prefix_url$url"
|
||||
|
||||
$fileName = Join-Path $destinationFolder $url
|
||||
Write-Host $fileName
|
||||
DownloadFileInChunks -url $oss_prefix_url$url -destinationFile $fileName -chunkSizeGB 0.1
|
||||
# Invoke-WebRequest -Uri $oss_prefix_url$url -OutFile $fileName
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user