From 4241ca1342328f6caf04611ec8c65b5e49629a92 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 23 Feb 2021 11:51:07 +0800 Subject: [PATCH] Revert "update docker" This reverts commit 224ea815 --- docker/notify_docker_user.js | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/docker/notify_docker_user.js b/docker/notify_docker_user.js index 84f90012..48b33362 100644 --- a/docker/notify_docker_user.js +++ b/docker/notify_docker_user.js @@ -1,27 +1,7 @@ const notify = require('../sendNotify'); -const fs = require('fs'); -const notifyPath = '/scripts/logs/notify.txt'; -async function image_update_notify() { - console.log(`文件是否存在${fs.existsSync('/scripts/logs/notify.txt')}`) - if (fs.existsSync(notifyPath)) { - //notify.txt文件存在 - const content = await fs.readFileSync(`${notifyPath}`, 'utf8');//读取notify.txt内容 - console.log(`/scripts/logs/notify.txt里面内容content${content}\n`) - console.log(`环境变量的内容${process.env.NOTIFY_CONTENT}\n`) - console.log(`匹配结果${JSON.stringify(content.match(/process.env.NOTIFY_CONTENT/g))}\n`) - if (!content.match(process.env.NOTIFY_CONTENT) && process.env.NOTIFY_CONTENT) { - await notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTENT); - //把通知内容写入notify.txt文件 - await fs.writeFileSync(`${notifyPath}`, JSON.stringify(process.env.NOTIFY_CONTENT)); - } - } else { - if (process.env.NOTIFY_CONTENT) { - notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTENT) - //把通知内容写入notify.txt文件 - await fs.writeFileSync(`${notifyPath}`, JSON.stringify(process.env.NOTIFY_CONTENT)); - } - } + +function image_update_notify() { + notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTEXT) } -!(async() => { - await image_update_notify(); -})().catch((e) => console.log(e)) \ No newline at end of file + +image_update_notify(); \ No newline at end of file