[ Cmii ] [ Operator ] - bug fix
This commit is contained in:
@@ -196,7 +196,7 @@ func (r *RabbitQueue) Handle() chan bool {
|
||||
|
||||
deliveries := r.Read(true)
|
||||
// 2024年4月9日
|
||||
r.ConsumeOK.Swap(true)
|
||||
r.ConsumeOK.Store(true)
|
||||
|
||||
foreverHandle := make(chan bool)
|
||||
// 死循环,处理Octopus Message
|
||||
@@ -217,7 +217,7 @@ func (r *RabbitQueue) Handle() chan bool {
|
||||
|
||||
// 2024年4月9日
|
||||
if !r.ConsumeOK.Load() {
|
||||
log.InfoF("Rabbit Queue of [%s] [%s[ disconnect!", r.RabbitProp.ExchangeName, r.RabbitProp.QueueName)
|
||||
log.InfoF("Rabbit Queue of [%s] [%s] disconnect!", r.RabbitProp.ExchangeName, r.RabbitProp.QueueName)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,16 +11,23 @@ agent_offline_proxy_conf=https://oss-1.107421.xyz/octopus-offline-nginx.conf
|
||||
default_octopus_agent_local_path=/data/github-action/octopus-agent/
|
||||
default_octopus_agent_config_local_path=/data/github-action/agent-config/
|
||||
default_octopus_agent_version_local_path=/data/github-action/agent-version
|
||||
agent_latest_version=2011-11-11-11
|
||||
|
||||
sync_octopus_agent() {
|
||||
|
||||
local octopus_agent_html="octopus_agent.html"
|
||||
# 如果本地已经是最新版本 那么不要更新
|
||||
if ls ${default_octopus_agent_local_path} | grep -q "${agent_latest_version}";then
|
||||
echo "agent already latest version => ${agent_latest_version}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local octopus_agent_html="octopus_agent_config.html"
|
||||
|
||||
rm -rf ${octopus_agent_html}
|
||||
wget "$octopus_agent_url/" -qO ${octopus_agent_html}
|
||||
|
||||
if [[ ! -s $octopus_agent_html ]]; then
|
||||
echo "[sync_octopus_agent] - download agent version file error ! return false !"
|
||||
echo "[sync_octopus_agent] - download agent file error ! return false !"
|
||||
return 233
|
||||
fi
|
||||
|
||||
@@ -30,14 +37,14 @@ sync_octopus_agent() {
|
||||
echo ""
|
||||
|
||||
echo "开始同步最新版本的Octopus Agent !"
|
||||
local octopus_agent_config_file_list=""
|
||||
local octopus_agent_file_list=""
|
||||
# shellcheck disable=SC2034
|
||||
octopus_agent_config_file_list=$(cat ${octopus_agent_html} | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | tr "\n" " ")
|
||||
octopus_agent_file_list=$(cat ${octopus_agent_html} | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | tr "\n" " ")
|
||||
local octopus_agent_config_list
|
||||
IFS=" " read -ra octopus_agent_config_list <<<"$octopus_agent_config_file_list"
|
||||
IFS=" " read -ra octopus_agent_file_list <<<"$octopus_agent_file_list"
|
||||
echo ""
|
||||
local octopus_agent_file
|
||||
for octopus_agent_file in "${octopus_agent_config_list[@]}"; do
|
||||
for octopus_agent_file in "${octopus_agent_file_list[@]}"; do
|
||||
echo "[sync_octopus_agent] => start to download => ${octopus_agent_url}/${octopus_agent_file}"
|
||||
wget "${octopus_agent_url}/${octopus_agent_file}" -qO "${default_octopus_agent_local_path}${octopus_agent_file}"
|
||||
echo ""
|
||||
@@ -109,7 +116,8 @@ sync_octopus_agent_config() {
|
||||
sync_octopus_agent_version() {
|
||||
# scp -P 22333 root@146.56.159.175:/data/
|
||||
rm -rf ${default_octopus_agent_version_local_path}
|
||||
curl -s -timeout=5 "${agent_version_url}" >${default_octopus_agent_version_local_path}
|
||||
agent_latest_version=$(curl -s -timeout=5 "${agent_version_url}")
|
||||
echo "${agent_latest_version}" > ${default_octopus_agent_version_local_path}
|
||||
|
||||
echo "[sync_octopus_agent_version] - agent latest version is => $(cat $default_octopus_agent_version_local_path)"
|
||||
echo ""
|
||||
@@ -142,12 +150,12 @@ sync_octopus_offline_nginx_proxy_conf() {
|
||||
|
||||
main() {
|
||||
|
||||
sync_octopus_agent_version
|
||||
|
||||
sync_octopus_agent
|
||||
|
||||
sync_octopus_agent_config
|
||||
|
||||
sync_octopus_agent_version
|
||||
|
||||
sync_octopus_offline_nginx_proxy_conf
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user