update docker
This commit is contained in:
@@ -121,3 +121,8 @@ crontab $mergedListFile
|
|||||||
|
|
||||||
echo "第10步将仓库的docker_entrypoint.sh脚本更新至系统/usr/local/bin/docker_entrypoint.sh内..."
|
echo "第10步将仓库的docker_entrypoint.sh脚本更新至系统/usr/local/bin/docker_entrypoint.sh内..."
|
||||||
cat /scripts/docker/docker_entrypoint.sh >/usr/local/bin/docker_entrypoint.sh
|
cat /scripts/docker/docker_entrypoint.sh >/usr/local/bin/docker_entrypoint.sh
|
||||||
|
|
||||||
|
echo "发送通知"
|
||||||
|
export NOTIFY_CONTENT="2021-02-21更新 https://gitee.com/lxk0301/jd_scripts仓库被迫私有,需重新更新一下镜像:https://hub.docker.com/r/lxk0301/jd_scripts,(注:国内第三方镜像目前可能不是最新请使用hub.docker.com镜像,docker-compose.yml的REPO_URL记得修改)后续可同步更新jd_script仓库最新脚本"
|
||||||
|
cd /scripts/docker
|
||||||
|
node notify_docker_user.js
|
@@ -1,9 +1,23 @@
|
|||||||
const notify = require('../sendNotify');
|
const notify = require('../sendNotify');
|
||||||
|
const fs = require('fs');
|
||||||
function image_update_notify() {
|
const notifyPath = '/scripts/logs/notify.txt';
|
||||||
if (process.env.NOTIFY_CONTENT) {
|
async function image_update_notify() {
|
||||||
notify.sendNotify("⚠️Docker镜像版本更新通知⚠️", process.env.NOTIFY_CONTENT)
|
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 {
|
||||||
|
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() => {
|
||||||
image_update_notify();
|
await image_update_notify();
|
||||||
|
})().catch((e) => console.log(e))
|
Reference in New Issue
Block a user