调整脚本

master
old易 2025-05-12 16:45:42 +08:00
parent 7beb557c68
commit 0758ee1020
1 changed files with 8 additions and 2 deletions

View File

@ -50,9 +50,15 @@ if [ $? -ne 0 ]; then
fi
# 为镜像打标签
# 打标签并推送
docker tag temp_image:latest "$IMAGE_NAME:$TAG"
if [ $? -ne 0 ]; then
echo "Docker 镜像打标签失败,请检查镜像名称和标签。"
docker tag temp_image:latest "$IMAGE_NAME:latest"
docker push "$IMAGE_NAME:$TAG"
docker push "$IMAGE_NAME:latest"
if [ $? -eq 0 ]; then
echo "✅ Docker 镜像推送成功: $IMAGE_NAME:$TAG & latest"
else
echo "❌ Docker 镜像推送失败。"
exit 1
fi