Merge pull request #7776 from dataease/pr@v2_refactor_dectl

refactor: 镜像未变化时,升级安装不重复加载镜像文件
This commit is contained in:
fit2cloudrd 2024-01-23 19:10:16 +08:00 committed by GitHub
commit 7bb9a610d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,6 +48,14 @@ DE_RUN_BASE=$DE_BASE/dataease2.0
conf_folder=${DE_RUN_BASE}/conf
templates_folder=${DE_RUN_BASE}/templates
if [[ $DE_RUN_BASE ]];then
for image in $(grep "image: " $DE_RUN_BASE/docker*.yml | awk -F 'image:' '{print $2}'); do
image_path=$(eval echo $image)
image_name=$(echo $image_path | awk -F "[/]" '{print $3}')
current_images[${#current_images[@]}]=$image_name
done
fi
function prop {
[ -f "$1" ] | grep -P "^\s*[^#]?${2}=.*$" $1 | cut -d'=' -f2
}
@ -183,7 +191,11 @@ cd ${CURRENT_DIR}
if [[ -d images ]]; then
log "加载镜像"
for i in $(ls images); do
docker load -i images/$i 2>&1 | tee -a ${CURRENT_DIR}/install.log
if [[ "${current_images[@]}" =~ "${i%.tar.gz}" ]]; then
echo "ignore image $i"
else
docker load -i images/$i 2>&1 | tee -a ${CURRENT_DIR}/install.log
fi
done
else
DEVERSION=$(cat ${CURRENT_DIR}/dataease/templates/version)