diff --git a/docker/default_task.sh b/docker/default_task.sh index f81f6fa4..5628f727 100644 --- a/docker/default_task.sh +++ b/docker/default_task.sh @@ -25,9 +25,9 @@ function version_gt() { #######################################通知用户更新镜像-start##################################################################### echo "检查docker镜像更新更新..." if type jq >/dev/null 2>&1; then - updateContext=$(getDockerImageLabel | jq .UPDATE_CONTEXT) - export NOTIFY_CONTEXT=$updateContext - version=$(getDockerImageLabel | jq .VERSION) + labels=$(getDockerImageLabel) + export NOTIFY_CONTENT=$(echo $labels | jq .UPDATE_CONTENT) + version=$(echo $labels | jq .VERSION) else # 第一版通知逻辑无法包含在上面判断里面,镜像构建好直接开启通知 export NOTIFY_CONTEXT="更新内容较多,重新阅读仓库Readme(),更新镜像并更新配置后使用。" diff --git a/docker/docker_entrypoint.sh b/docker/docker_entrypoint.sh index cc0c2fad..dbc204d3 100644 --- a/docker/docker_entrypoint.sh +++ b/docker/docker_entrypoint.sh @@ -37,12 +37,12 @@ function version_gt() { echo "check docker images update..." echo "检查docker镜像更新更新..." if type jq >/dev/null 2>&1; then - updateContext=$(getDockerImageLabel | jq .UPDATE_CONTEXT) - export NOTIFY_CONTEXT=$updateContext - version=$(getDockerImageLabel | jq .VERSION) + labels=$(getDockerImageLabel) + export NOTIFY_CONTENT=$(echo $labels | jq .UPDATE_CONTENT) + version=$(echo $labels | jq .VERSION) else #第一版通知逻辑无法包含在上面判断里面,镜像构建好直接开启通知 - export NOTIFY_CONTEXT="更新内容较多,重新阅读仓库Readme(),更新镜像并更新配置后使用。" + export NOTIFY_CONTENT="更新内容较多,重新阅读仓库Readme(),更新镜像并更新配置后使用。" cd /scripts/docker node notify_docker_user.js fi diff --git a/docker/notify_docker_user.js b/docker/notify_docker_user.js index 4516f663..55916d06 100644 --- a/docker/notify_docker_user.js +++ b/docker/notify_docker_user.js @@ -1,7 +1,9 @@ const notify = require('../sendNotify'); function image_update_notify() { - notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTEXT) + if (process.env.NOTIFY_CONTENT) { + notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTENT) + } } image_update_notify(); \ No newline at end of file