镜像增加一个moreutils包调整日志输出格式
- 新增一个crontab_list_ts.sh是为了照顾未及时更新镜像的小伙伴定时任务不出错 - 删除三个PNG图片改为GITHUB图床,让目录看起来没那么乱 - 调整README调整docker-compose.yml说明如果使用仓库定义的定时任务,不需要在传CRONTAB_LIST_FILE变量
This commit is contained in:
@@ -3,7 +3,7 @@ MAINTAINER Akira <e.akimoto.akira@gmail.com>
|
|||||||
|
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& apk update && apk upgrade\
|
&& apk update && apk upgrade\
|
||||||
&& apk add --no-cache tzdata git nodejs npm\
|
&& apk add --no-cache tzdata moreutils git nodejs npm\
|
||||||
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||||
&& echo "Asia/Shanghai" > /etc/timezone
|
&& echo "Asia/Shanghai" > /etc/timezone
|
||||||
|
|
||||||
@@ -14,10 +14,10 @@ RUN git clone https://github.com/lxk0301/jd_scripts /scripts \
|
|||||||
&& cd ~ \
|
&& cd ~ \
|
||||||
&& npm install request
|
&& npm install request
|
||||||
|
|
||||||
ENV CDN_JD_DAILYBONUS true
|
ENV CRONTAB_LIST_FILE crontab_list_ts.sh
|
||||||
|
|
||||||
RUN crontab /scripts/docker/crontab_list.sh
|
RUN crontab /scripts/docker/crontab_list_ts.sh
|
||||||
|
|
||||||
WORKDIR /scripts
|
WORKDIR /scripts
|
||||||
|
|
||||||
CMD ["node"]
|
CMD ["node"]
|
@@ -22,55 +22,63 @@ jd_scripts
|
|||||||
- `jd_scripts/docker-compose.yml` 参考内容如下:
|
- `jd_scripts/docker-compose.yml` 参考内容如下:
|
||||||
- `jd_scripts/docker-compose.yml`里面的环境变量(`environment:`)配置[参考这里](https://github.com/lxk0301/jd_scripts/blob/master/githubAction.md#%E4%B8%8B%E6%96%B9%E6%8F%90%E4%BE%9B%E4%BD%BF%E7%94%A8%E5%88%B0%E7%9A%84-secrets%E5%85%A8%E9%9B%86%E5%90%88)
|
- `jd_scripts/docker-compose.yml`里面的环境变量(`environment:`)配置[参考这里](https://github.com/lxk0301/jd_scripts/blob/master/githubAction.md#%E4%B8%8B%E6%96%B9%E6%8F%90%E4%BE%9B%E4%BD%BF%E7%94%A8%E5%88%B0%E7%9A%84-secrets%E5%85%A8%E9%9B%86%E5%90%88)
|
||||||
```yaml
|
```yaml
|
||||||
|
jd_scripts:
|
||||||
jd_scripts:
|
jd_scripts:
|
||||||
image: akyakya/jd_scripts
|
image: akyakya/jd_scripts
|
||||||
container_name: jd_scripts
|
container_name: jd_scripts
|
||||||
restart: always
|
restart: always
|
||||||
#如果需要自定定义定时任务的需要自己写好`my_crontab_list.sh`文件 ,取消下面的注释 ,通过 `volumes`挂载进去。
|
#如果需要自定定义定时任务的需要自己写好`my_crontab_list.sh`文件 ,取消下面的挂载注释 ,通过 `volumes`挂载进去。
|
||||||
volumes:
|
volumes:
|
||||||
|
# - ./my_crontab_list.sh:/scripts/docker/my_crontab_list.sh
|
||||||
- ./logs:/scripts/logs
|
- ./logs:/scripts/logs
|
||||||
# - ./my_crontab_list.sh:/scripts/docker/my_crontab_list.sh
|
|
||||||
tty: true
|
tty: true
|
||||||
environment:
|
environment:
|
||||||
# 注意环境变量填写值的时候一律不需要引号(")下面这些只是事例,根据自己的需求增加删除
|
# 注意环境变量填写值的时候一律不需要引号(""或者'')下面这些只是事例,根据自己的需求增加删除
|
||||||
#jd cookies
|
#jd cookies
|
||||||
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
# 例: JD_COOKIE=pt_key=XXX;pt_pin=XXX
|
||||||
|
- JD_COOKIE=
|
||||||
#微信server酱通
|
#微信server酱通
|
||||||
- PUSH_KEY=""
|
- PUSH_KEY=
|
||||||
#Bark App通知
|
#Bark App通知
|
||||||
- BARK_PUSH=""
|
- BARK_PUSH=
|
||||||
#telegram机器人通知
|
#telegram机器人通知
|
||||||
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
- TG_BOT_TOKEN=
|
||||||
- TG_USER_ID=12xxxx206
|
- TG_USER_ID=
|
||||||
#钉钉机器人通知
|
#钉钉机器人通知
|
||||||
- DD_BOT_TOKEN=""
|
- DD_BOT_TOKEN=
|
||||||
- DD_BOT_SECRET=""
|
- DD_BOT_SECRET=
|
||||||
#京东种豆得豆
|
#京东种豆得豆
|
||||||
- PLANT_BEAN_SHARECODES=""
|
- PLANT_BEAN_SHARECODES=
|
||||||
#京东农场
|
#京东农场
|
||||||
- FRUITSHARECODES=""
|
# 例: FRUITSHARECODES=京东农场的互助码
|
||||||
|
- FRUITSHARECODES=
|
||||||
#京东萌宠
|
#京东萌宠
|
||||||
- PETSHARECODES=""
|
# 例: PETSHARECODES=东东萌宠的互助码
|
||||||
- JOY_FEED_COUNT=""
|
- PETSHARECODES=
|
||||||
|
# 宠汪汪的喂食数量
|
||||||
|
- JOY_FEED_COUNT=
|
||||||
#京小超
|
#京小超
|
||||||
- SUPERMARKET_SHARECODES=""
|
# - SUPERMARKET_SHARECODES=
|
||||||
#兑换多少数量的京豆(1-20之间,或者1000),0默认兑换不兑换,如需兑换把0改成1-20之间的数字或者1000即可
|
#兑换多少数量的京豆(20,或者1000京豆,或者其他奖品的文字)
|
||||||
- MARKET_COIN_TO_BEANS=""
|
# 例: MARKET_COIN_TO_BEANS=1000
|
||||||
|
- MARKET_COIN_TO_BEANS=
|
||||||
#是否开启debug模式打印日志
|
#是否开启debug模式打印日志
|
||||||
- JD_DEBUG=""
|
# 例: JD_DEBUG=false
|
||||||
#该字段必须配置是否使用了自定义定时任务列表,使用了需要把这个名字改成my_crontab_list.sh
|
- JD_DEBUG=
|
||||||
- CRONTAB_LIST_FILE=crontab_list.sh
|
#如果使用自定义定时任务,取消下面一行的注释
|
||||||
|
#- CRONTAB_LIST_FILE=my_crontab_list.sh
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
#crontab /scripts/docker/my_crontab_list.sh #如果挂载了自定义任务文件 需要在 crond 的上面加行
|
#crontab /scripts/docker/my_crontab_list.sh #如果挂载了自定义任务文件,取消此条注释即可
|
||||||
crond
|
crond
|
||||||
|
git -C /scripts/ pull
|
||||||
node
|
node
|
||||||
```
|
```
|
||||||
- `jd_scripts/my_crontab_list.sh` 参考内容如下:
|
- `jd_scripts/my_crontab_list.sh` 参考内容如下(输出日志的最后加上 `|ts` 可在日志每一行前面显示时间):
|
||||||
```shell
|
```shell
|
||||||
0 */1 * * * git -C /scripts/ pull >> /scripts/logs/pull.log 2>&1
|
0 */1 * * * git -C /scripts/ pull >> /scripts/logs/pull.log 2>&1|ts
|
||||||
2 0 * * * node /scripts/jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1
|
2 0 * * * node /scripts/jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1
|
||||||
2 0 * * * node /scripts/jd_blueCoin.js >> /scripts/logs/jd_blueCoin.log 2>&1
|
2 0 * * * node /scripts/jd_blueCoin.js >> /scripts/logs/jd_blueCoin.log 2>&1
|
||||||
2 0 * * * node /scripts/jd_club_lottery.js >> /scripts/logs/jd_club_lottery.log 2>&1
|
2 0 * * * node /scripts/jd_club_lottery.js >> /scripts/logs/jd_club_lottery.log 2>&1
|
||||||
@@ -98,6 +106,9 @@ jd_scripts:
|
|||||||
- 如果是群晖用户,在docker注册表搜jd_scripts,双击下载映像。
|
- 如果是群晖用户,在docker注册表搜jd_scripts,双击下载映像。
|
||||||
不需要docker-compose.yml,只需建个logs/目录,调整`jd_scripts.syno.json`里面对应的配置值,然后导入json配置新建容器。
|
不需要docker-compose.yml,只需建个logs/目录,调整`jd_scripts.syno.json`里面对应的配置值,然后导入json配置新建容器。
|
||||||
若要自定义my_crontab_list.sh,再建个my_crontab_list.sh文件,配置参考`jd_scripts.my_crontab_list.syno.json`。
|
若要自定义my_crontab_list.sh,再建个my_crontab_list.sh文件,配置参考`jd_scripts.my_crontab_list.syno.json`。
|
||||||

|

|
||||||

|
|
||||||

|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
55
docker/crontab_list_ts.sh
Normal file
55
docker/crontab_list_ts.sh
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
0 */1 * * * git -C /scripts/ pull >> /scripts/logs/pull.log 2>&1|ts
|
||||||
|
2 */1 * * * crontab /scripts/docker/${CRONTAB_LIST_FILE}
|
||||||
|
3 */1 * * * npm install --prefix /scripts >> /scripts/logs/npm_install.log 2>&1|ts
|
||||||
|
# 每3天的23:50分清理一次日志
|
||||||
|
50 23 */3 * * rm -rf /scripts/logs/*.log
|
||||||
|
|
||||||
|
|
||||||
|
##############短期活动##############
|
||||||
|
# 暂无
|
||||||
|
|
||||||
|
|
||||||
|
##############长期活动##############
|
||||||
|
|
||||||
|
# 签到
|
||||||
|
0 0,12,18 * * * node /scripts/jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1|ts
|
||||||
|
# 京小超兑换奖品
|
||||||
|
0 0 * * * node /scripts/jd_blueCoin.js >> /scripts/logs/jd_blueCoin.log 2>&1|ts
|
||||||
|
# 摇京豆
|
||||||
|
0 0 * * * node /scripts/jd_club_lottery.js >> /scripts/logs/jd_club_lottery.log 2>&1|ts
|
||||||
|
# 东东农场
|
||||||
|
5 6-18/6 * * * node /scripts/jd_fruit.js >> /scripts/logs/jd_fruit.log 2>&1|ts
|
||||||
|
# 宠汪汪
|
||||||
|
15 */2 * * * node /scripts/jd_joy.js >> /scripts/logs/jd_joy.log 2>&1|ts
|
||||||
|
# 宠汪汪喂食
|
||||||
|
15 */1 * * * node /scripts/jd_joy_feedPets.js >> /scripts/logs/jd_joy_feedPets.log 2>&1|ts
|
||||||
|
# 宠汪汪积分兑换奖品
|
||||||
|
0 0-16/8 * * * node /scripts/jd_joy_reward.js >> /scripts/logs/jd_joy_reward.log 2>&1|ts
|
||||||
|
# 宠汪汪偷好友积分与狗粮
|
||||||
|
0 0,6 * * * node /scripts/jd_joy_steal.js >> /scripts/logs/jd_joy_steal.log 2>&1|ts
|
||||||
|
# 摇钱树
|
||||||
|
0 */2 * * * node /scripts/jd_moneyTree.js >> /scripts/logs/jd_moneyTree.log 2>&1|ts
|
||||||
|
# 东东萌宠
|
||||||
|
5 6-18/6 * * * node /scripts/jd_pet.js >> /scripts/logs/jd_pet.log 2>&1|ts
|
||||||
|
# 京东种豆得豆
|
||||||
|
0 7-22/1 * * * node /scripts/jd_plantBean.js >> /scripts/logs/jd_plantBean.log 2>&1|ts
|
||||||
|
# 京东全民开红包
|
||||||
|
1 1 * * * node /scripts/jd_redPacket.js >> /scripts/logs/jd_redPacket.log 2>&1|ts
|
||||||
|
# 进店领豆
|
||||||
|
10 0 * * * node /scripts/jd_shop.js >> /scripts/logs/jd_shop.log 2>&1|ts
|
||||||
|
# 京东天天加速
|
||||||
|
8 */3 * * * node /scripts/jd_speed.js >> /scripts/logs/jd_speed.log 2>&1|ts
|
||||||
|
# 东东超市
|
||||||
|
11 1-23/5 * * * node /scripts/jd_superMarket.js >> /scripts/logs/jd_superMarket.log 2>&1|ts
|
||||||
|
# 取关京东店铺商品
|
||||||
|
55 23 * * * node /scripts/jd_unsubscribe.js >> /scripts/logs/jd_unsubscribe.log 2>&1|ts
|
||||||
|
# 京豆变动通知
|
||||||
|
0 2 * * * node /scripts/jd_bean_change.js >> /scripts/logs/jd_bean_change.log 2>&1|ts
|
||||||
|
# 京东抽奖机
|
||||||
|
11 1 * * * node /scripts/jd_lotteryMachine.js >> /scripts/logs/jd_lotteryMachine.log 2>&1|ts
|
||||||
|
# 京东排行榜
|
||||||
|
11 9 * * * node /scripts/jd_rankingList.js >> /scripts/logs/jd_rankingList.log 2>&1|ts
|
||||||
|
# 天天提鹅
|
||||||
|
18 */3 * * * node /scripts/jd_daily_egg.js >> /scripts/logs/jd_daily_egg.log 2>&1|ts
|
||||||
|
# 金融养猪
|
||||||
|
12 13 * * * node /scripts/jd_pigPet.js >> /scripts/logs/jd_pigPet.log 2>&1|ts
|
BIN
docker/dir.png
BIN
docker/dir.png
Binary file not shown.
Before Width: | Height: | Size: 48 KiB |
@@ -40,8 +40,8 @@ jd_scripts:
|
|||||||
#是否开启debug模式打印日志
|
#是否开启debug模式打印日志
|
||||||
# 例: JD_DEBUG=false
|
# 例: JD_DEBUG=false
|
||||||
- JD_DEBUG=
|
- JD_DEBUG=
|
||||||
#是否使用了自定义定时任务,这个名字改成my_crontab_list.sh
|
#如果使用自定义定时任务,取消下面一行的注释
|
||||||
- CRONTAB_LIST_FILE=crontab_list.sh
|
#- CRONTAB_LIST_FILE=my_crontab_list.sh
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 117 KiB |
BIN
docker/info.png
BIN
docker/info.png
Binary file not shown.
Before Width: | Height: | Size: 201 KiB |
Reference in New Issue
Block a user