[ agent ] [ boot ] - agent boot up procedure - 14
This commit is contained in:
@@ -122,7 +122,7 @@ check_sys() {
|
|||||||
|
|
||||||
# 判断系统的包管理工具 apt, yum, or zypper
|
# 判断系统的包管理工具 apt, yum, or zypper
|
||||||
getPackageManageTool() {
|
getPackageManageTool() {
|
||||||
if [[ -n $(command -v apt-getMapper) ]]; then
|
if [[ -n $(command -v apt-get) ]]; then
|
||||||
CMD_INSTALL="apt-get -y -qq install"
|
CMD_INSTALL="apt-get -y -qq install"
|
||||||
CMD_UPDATE="apt-get -qq update"
|
CMD_UPDATE="apt-get -qq update"
|
||||||
CMD_REMOVE="apt-get -y remove"
|
CMD_REMOVE="apt-get -y remove"
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ if [[ $(cat /etc/hostname | cut -d"-" -f 3 | grep -c '^[0-9][0-9]') -gt 0 ]]; th
|
|||||||
else
|
else
|
||||||
machineNumber=99
|
machineNumber=99
|
||||||
fi
|
fi
|
||||||
|
cat >>/etc/environment<<EOF
|
||||||
export serverName="${city}-${hostArch}-${machineNumber}"
|
export serverName="${city}-${hostArch}-${machineNumber}"
|
||||||
export serverIpPbV4="$public_ipv4"
|
export serverIpPbV4="$public_ipv4"
|
||||||
export serverIpInV4=""
|
export serverIpInV4=""
|
||||||
@@ -279,5 +279,11 @@ export osKernelInfo="$kern"
|
|||||||
export tcpControl="$tcpctrl"
|
export tcpControl="$tcpctrl"
|
||||||
export virtualization="$virt"
|
export virtualization="$virt"
|
||||||
export ioSpeed="$ioavg MB/s"
|
export ioSpeed="$ioavg MB/s"
|
||||||
export machineId="$(cat /host/etc/machine-id)"
|
export machineId="$(cat /etc/machine-id)"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
log "env collect complete!"
|
||||||
|
source /etc/environment
|
||||||
|
|
||||||
|
env
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ check_sys() {
|
|||||||
hostArch="arm64"
|
hostArch="arm64"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
colorEcho ${RED} "
|
error "
|
||||||
哈哈……这个 辣鸡脚本 不支持你的系统。 (-_-) \n
|
哈哈……这个 辣鸡脚本 不支持你的系统。 (-_-) \n
|
||||||
备注: 仅支持 Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统
|
备注: 仅支持 Ubuntu 16+ / Debian 8+ / CentOS 7+ 系统
|
||||||
" && exit 1
|
" && exit 1
|
||||||
@@ -88,7 +88,7 @@ check_sys() {
|
|||||||
# 检查系统包管理方式,更新包
|
# 检查系统包管理方式,更新包
|
||||||
getPackageManageTool
|
getPackageManageTool
|
||||||
if [[ $? -eq 1 ]]; then
|
if [[ $? -eq 1 ]]; then
|
||||||
colorEcho ${RED} "系统的包管理不是 APT or YUM, 请手动安装所需要的软件."
|
error "系统的包管理不是 APT or YUM, 请手动安装所需要的软件."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ tmp () {
|
|||||||
gcloud compute instances create octopus-agent-2c-4g-1 --project=compact-lacing-371804 --zone=asia-northeast1-b --machine-type=n2d-custom-2-4096 --network-interface=network-tier=PREMIUM,subnet=default --metadata=startup-script=wget\ https://raw.githubusercontent.com/zeaslity/ProjectOctopus/main/source/src/main/java/io/wdd/source/shell/agent-bootup.sh\ \&\&\ chmod\ \+x\ agent-bootup.sh\ \&\&\ /bin/bash\ agent-bootup.sh --can-ip-forward --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=172889627951-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --create-disk=auto-delete=yes,boot=yes,device-name=octopus-agent-2c-4g,image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20221213,mode=rw,size=20,type=projects/compact-lacing-371804/zones/us-west4-b/diskTypes/pd-ssd --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --reservation-affinity=any
|
gcloud compute instances create octopus-agent-2c-4g-1 --project=compact-lacing-371804 --zone=asia-northeast1-b --machine-type=n2d-custom-2-4096 --network-interface=network-tier=PREMIUM,subnet=default --metadata=startup-script=wget\ https://raw.githubusercontent.com/zeaslity/ProjectOctopus/main/source/src/main/java/io/wdd/source/shell/agent-bootup.sh\ \&\&\ chmod\ \+x\ agent-bootup.sh\ \&\&\ /bin/bash\ agent-bootup.sh --can-ip-forward --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=172889627951-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --create-disk=auto-delete=yes,boot=yes,device-name=octopus-agent-2c-4g,image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20221213,mode=rw,size=20,type=projects/compact-lacing-371804/zones/us-west4-b/diskTypes/pd-ssd --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --reservation-affinity=any
|
||||||
|
|
||||||
|
|
||||||
gcloud compute instances delete octopus-agent-2c-4g-1 --project=compact-lacing-371804 --zone=asia-northeast1-b
|
gcloud compute instances delete octopus-agent-2c-4g-7 --project=compact-lacing-371804 --zone=asia-northeast1-b
|
||||||
|
|
||||||
|
|
||||||
gcloud compute instances create octopus-agent-2c-4g-7 --project=compact-lacing-371804 --zone=asia-northeast1-b --machine-type=n2d-custom-2-4096 --network-interface=network-tier=PREMIUM,subnet=default --can-ip-forward --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=172889627951-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --create-disk=auto-delete=yes,boot=yes,device-name=octopus-agent-2c-4g,image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20221213,mode=rw,size=20,type=projects/compact-lacing-371804/zones/us-west4-b/diskTypes/pd-ssd --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --reservation-affinity=any
|
gcloud compute instances create octopus-agent-2c-4g-7 --project=compact-lacing-371804 --zone=asia-northeast1-b --machine-type=n2d-custom-2-4096 --network-interface=network-tier=PREMIUM,subnet=default --can-ip-forward --maintenance-policy=MIGRATE --provisioning-model=STANDARD --service-account=172889627951-compute@developer.gserviceaccount.com --scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append --create-disk=auto-delete=yes,boot=yes,device-name=octopus-agent-2c-4g,image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20221213,mode=rw,size=20,type=projects/compact-lacing-371804/zones/us-west4-b/diskTypes/pd-ssd --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --reservation-affinity=any
|
||||||
|
|||||||
Reference in New Issue
Block a user