Revert "update docker"
This reverts commit ec975fde
This commit is contained in:
@@ -1,7 +1,23 @@
|
|||||||
const notify = require('../sendNotify');
|
const notify = require('../sendNotify');
|
||||||
|
const fs = require('fs');
|
||||||
function image_update_notify() {
|
const notifyPath = '/scripts/logs/notify.txt';
|
||||||
notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTEXT)
|
async function image_update_notify() {
|
||||||
|
if (fs.existsSync(notifyPath)) {
|
||||||
|
//notify.txt文件存在
|
||||||
|
const content = await fs.readFileSync(`${notifyPath}`, 'utf8');//读取notify.txt内容
|
||||||
|
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 {
|
||||||
image_update_notify();
|
if (process.env.NOTIFY_CONTENT) {
|
||||||
|
notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTENT)
|
||||||
|
//把通知内容写入notify.txt文件
|
||||||
|
await fs.writeFileSync(`${notifyPath}`, JSON.stringify(process.env.NOTIFY_CONTENT));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
!(async() => {
|
||||||
|
await image_update_notify();
|
||||||
|
})().catch((e) => console.log(e))
|
Reference in New Issue
Block a user