mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-24 01:50:19 +08:00
Update containers_version.sh
This commit is contained in:
parent
57013f5ed8
commit
dfca9d126b
@ -44,7 +44,18 @@ for appinfo in $(docker ps --format '{{.Names}}%{{.Image}}'); do
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "通过服务名匹配"
|
# 容器和镜像均未匹配成功,通过服务名匹配
|
||||||
|
realapp=echo $containername|awk -F"-" '{print $1}'
|
||||||
|
services=docker compose -p $realapp ps --services
|
||||||
|
for service in $services; do
|
||||||
|
if [[ $service == $appname ]];then
|
||||||
|
echo "$containername容器匹配成功app:$appname"
|
||||||
|
initdata="$initdata $appname"
|
||||||
|
wget -O /tmp/$appname_get_version.sh https://raw.githubusercontent.com/Websoft9/docker-$appname/main/src/get_version.sh
|
||||||
|
bash /tmp/$appname_get_version.sh $containername
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user