[ server ] [ executor ] - optimize code -5
This commit is contained in:
20
server/src/main/resources/application-local.yml
Normal file
20
server/src/main/resources/application-local.yml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: octopus-server
|
||||||
|
profiles:
|
||||||
|
active: local
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
config:
|
||||||
|
group: local
|
||||||
|
config-retry-time: 3000
|
||||||
|
file-extension: yaml
|
||||||
|
max-retry: 3
|
||||||
|
# server-addr: 43.154.83.213:21060
|
||||||
|
# server-addr: 140.238.52.228:21060
|
||||||
|
server-addr: https://nacos.107421.xyz:443
|
||||||
|
timeout: 5000
|
||||||
|
config-long-poll-timeout: 5000
|
||||||
|
extension-configs:
|
||||||
|
- group: local
|
||||||
|
data-id: common-local.yaml
|
||||||
@@ -2,11 +2,11 @@ spring:
|
|||||||
application:
|
application:
|
||||||
name: octopus-server
|
name: octopus-server
|
||||||
profiles:
|
profiles:
|
||||||
active: local
|
active: k3s
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
config:
|
config:
|
||||||
group: local
|
group: k3s
|
||||||
config-retry-time: 3000
|
config-retry-time: 3000
|
||||||
file-extension: yaml
|
file-extension: yaml
|
||||||
max-retry: 3
|
max-retry: 3
|
||||||
@@ -16,5 +16,5 @@ spring:
|
|||||||
timeout: 5000
|
timeout: 5000
|
||||||
config-long-poll-timeout: 5000
|
config-long-poll-timeout: 5000
|
||||||
extension-configs:
|
extension-configs:
|
||||||
- group: local
|
- group: k3s
|
||||||
data-id: common-local.yaml
|
data-id: common-k3s.yaml
|
||||||
@@ -204,11 +204,12 @@ DownloadAllFile() {
|
|||||||
colorEcho $BLUE "start to download octopus agent !"
|
colorEcho $BLUE "start to download octopus agent !"
|
||||||
# check for latest version
|
# check for latest version
|
||||||
# download the lasted jar
|
# download the lasted jar
|
||||||
cd /optopus-agent
|
cd $OctopusAgentPath
|
||||||
. ./shell/lib/wdd-lib-os.sh
|
colorEcho $BLUE "start to load wdd-lib-os.sh"
|
||||||
|
. ./lib/wdd-lib-os.sh
|
||||||
CheckAndDownloadLatestVersion
|
CheckAndDownloadLatestVersion
|
||||||
|
|
||||||
|
|
||||||
FunctionSuccess
|
FunctionSuccess
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
|
|
||||||
. ./lib/wdd-lib-log.sh
|
|
||||||
. ./lib/wdd-lib-sys.sh
|
|
||||||
|
|
||||||
|
|
||||||
FunctionStart
|
|
||||||
|
|
||||||
log "prepare the env"
|
|
||||||
chmod +x ./lib/wdd-lib-env.sh
|
|
||||||
./lib/wdd-lib-env.sh
|
|
||||||
|
|
||||||
systemctl stop octopus-agent.service
|
|
||||||
systemctl start octopus-agent.service
|
|
||||||
|
|
||||||
FunctionSuccess
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
|
|
||||||
20
source/src/main/java/io/wdd/source/shell/agent-restart.sh
Normal file
20
source/src/main/java/io/wdd/source/shell/agent-restart.sh
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
. /octopus-agent/shell/lib/wdd-lib-log.sh
|
||||||
|
. /octopus-agent/shell/lib/wdd-lib-sys.sh
|
||||||
|
|
||||||
|
|
||||||
|
FunctionStart
|
||||||
|
|
||||||
|
log "prepare the env"
|
||||||
|
chmod +x /octopus-agent/shell/lib/wdd-lib-env.sh
|
||||||
|
/octopus-agent/shell/lib/wdd-lib-env.sh
|
||||||
|
|
||||||
|
systemctl stop octopus-agent.service
|
||||||
|
systemctl start octopus-agent.service
|
||||||
|
|
||||||
|
FunctionSuccess
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
|
|
||||||
@@ -1,25 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
. ./lib/wdd-lib-log.sh
|
. /octopus-agent/shell/lib/wdd-lib-log.sh
|
||||||
. ./lib/wdd-lib-sys.sh
|
. /octopus-agent/shell/lib/wdd-lib-sys.sh
|
||||||
. ./lib/wdd-lib-os.sh
|
. /octopus-agent/shell/lib/wdd-lib-os.sh
|
||||||
|
|
||||||
|
|
||||||
RepoSourcePath=https://raw.githubusercontent.com/zeaslity/ProjectOctopus/main/source/src/main/java/io/wdd/source/shell
|
RepoSourcePath=https://raw.githubusercontent.com/zeaslity/ProjectOctopus/main/source/src/main/java/io/wdd/source/shell
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CheckAndDownloadLatestVersion
|
CheckAndDownloadLatestVersion
|
||||||
|
|
||||||
|
if [[ ! -f /octopus-agent/shell/agent-reboot.sh ]]; then\
|
||||||
if [[ ! -f /octopus-agent/agent-reboot.sh ]]; then\
|
|
||||||
warn "agent-bootup.sh not exist! start to download !"
|
warn "agent-bootup.sh not exist! start to download !"
|
||||||
cd /octopus-agent
|
cd /octopus-agent/shell
|
||||||
wget $RepoSourcePath/agent-reboot.sh
|
wget $RepoSourcePath/agent-reboot.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
log "start to reboot the octopus agent !"
|
log "start to reboot the octopus agent !"
|
||||||
chmod +x /octopus-agent/agent-reboot.sh
|
chmod +x /octopus-agent/shell/agent-reboot.sh
|
||||||
/octopus-agent/agent-reboot.sh
|
/octopus-agent/shell/agent-reboot.sh
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ export location="$city $region $country"
|
|||||||
export provider=$org
|
export provider=$org
|
||||||
export managePort=$(netstat -ntulp | grep sshd | grep -w tcp | awk '{print$4}' | cut -d":" -f2)
|
export managePort=$(netstat -ntulp | grep sshd | grep -w tcp | awk '{print$4}' | cut -d":" -f2)
|
||||||
export cpuCore="$cores @ $freq MHz"
|
export cpuCore="$cores @ $freq MHz"
|
||||||
export cpuBrand=$cpuName
|
export cpuBrand="$cpuName"
|
||||||
export memoryTotal=$tram
|
export memoryTotal=$tram
|
||||||
export diskTotal=$disk_total_size
|
export diskTotal=$disk_total_size
|
||||||
export diskUsage=$disk_used_size
|
export diskUsage=$disk_used_size
|
||||||
|
|||||||
@@ -19,9 +19,12 @@ CheckAndDownloadLatestVersion(){
|
|||||||
log "start to download the latest version !"
|
log "start to download the latest version !"
|
||||||
|
|
||||||
wget "$OctopusAgentUrl$latestVersion"
|
wget "$OctopusAgentUrl$latestVersion"
|
||||||
cp "$OctopusAgentUrl$latestVersion" agent.jar
|
cp "$latestVersion" agent.jar
|
||||||
|
|
||||||
log ""
|
log ""
|
||||||
|
echo ""
|
||||||
|
log "----------------------------------------------"
|
||||||
ls /octopus-agent/ | grep jar
|
ls /octopus-agent/ | grep jar
|
||||||
|
log "----------------------------------------------"
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
. /octopus-agent/shell/lib/wdd-lib-log.sh
|
. /octopus-agent/shell/lib/wdd-lib-log.sh
|
||||||
|
|
||||||
|
|
||||||
@@ -140,12 +138,12 @@ 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-7 --project=compact-lacing-371804 --zone=asia-northeast1-b
|
gcloud compute instances delete tokyo-amd64-03 --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 tokyo-amd64-03 --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 ssh --zone "asia-northeast1-b" "octopus-agent-2c-4g-7" --project "compact-lacing-371804"
|
gcloud compute ssh --zone "asia-northeast1-b" "tokyo-amd64-03" --project "compact-lacing-371804"
|
||||||
|
|
||||||
|
|
||||||
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
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user