Commit 19775edc authored by yaozheng's avatar yaozheng

增加流量线测试群提醒

parent 033d9996
import datetime
import os
import sys
# 把项目的根目录通过sys.path.append添加为执行时的环境变量
import time
current_directory = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath(os.path.dirname(current_directory) + os.path.sep + ".")
sys.path.append(root_path)
from robot.task import Task
# Task.liuliang_everyday1()
from apscheduler.schedulers.blocking import BlockingScheduler
def run():
scheduler = BlockingScheduler()
# 流量线值班人群里早上9:30提醒值班人值班
# scheduler.add_job(func=Task.zhiban, trigger='cron', hour=9, minute=30)
# 测试群关键事项提醒,周一到周五的17:30
scheduler.add_job(func=Task.ceshi, trigger='cron', day_of_week=(0, 1, 2, 3, 4), hour=17, minute=30)
# 流量线值班人群里晚上18:00提醒值班人值班
# scheduler.add_job(func=Task.zhiban1, trigger='cron', hour=18)
scheduler.start()
Task.ceshi()
if __name__ == "__main__":
run()
......@@ -11,9 +11,9 @@ class Task:
secret = 'SEC7e57fbdd5b20103208482f520420139072d84c754a3cd624641623bd2f225af3'
text = '***今天排查的线上问题记录了吗?\n\n\r 测试用例上传了吗?\n\n\r 提测bug都提交了吗?\n\n\r 今天上线的需求都线上回归了吗?\n\n\r 业务文档都更新了吗?***'
btns = [{
"title": "线上问题记录",
"actionURL": "http://cf.dui88.com/pages/viewpage.action?pageId=97986428"
},
"title": "线上问题记录",
"actionURL": "http://cf.dui88.com/pages/viewpage.action?pageId=97986428"
},
{
"title": "测试用例上传",
"actionURL": "http://cf.dui88.com/pages/viewpage.action?pageId=67163062"
......@@ -27,7 +27,8 @@ class Task:
"actionURL": "http://cf.dui88.com/pages/viewpage.action?pageId=78912619"
}
]
Remind.send_alone_actionCard(token=token, secret=secret, title='下班前想一想', text=text, btnOrientation='1', btns=btns)
Remind.send_alone_actionCard(token=token, secret=secret, title='下班前想一想', text=text, btnOrientation='1',
btns=btns)
@classmethod
def liuliang_everyday1(cls):
......@@ -65,4 +66,41 @@ class Task:
if currentday == 4:
text = text + '\n> ***测试周报都写了吗?*** [去写周报](http://cf.dui88.com/pages/viewpage.action?pageId=92507929) '
Remind.send_markdown(token=token, secret=secret, title='下班前想一想', text=text, at=at)
\ No newline at end of file
Remind.send_markdown(token=token, secret=secret, title='下班前想一想', text=text, at=at)
@classmethod
def zhiban(cls):
zhibanren = [['赵杨晶', '18100175672'],
['吉月琳', '15372438813'],
['达敏', '18658862085'],
['吴翠萍', '15201297871'],
['黄博涛', '13641464105'],
['刘尖学', '18367117637'],
['蒋佳杰', '15957195421']]
token = '903ab8b3ba3d46e7c8b934ef83038bd6037e56c04a985e43fab8f2e0bd359cad'
secret = 'SEC7e57fbdd5b20103208482f520420139072d84c754a3cd624641623bd2f225af3'
# 获取当天日期
currentdate = datetime.date.today()
currentday = calendar.weekday(currentdate.year, currentdate.month, currentdate.day)
text = '今日技术值班人:' + zhibanren[currentday][0] + ',请关注问题反馈群,及时跟进群任务'
at = {'atMobiles': [zhibanren[currentday][1]]}
Remind.send_messages(token, secret, text, at)
@classmethod
def zhiban1(cls):
zhibanren = [['赵杨晶', '18100175672'],
['吉月琳', '15372438813'],
['达敏', '18658862085'],
['吴翠萍', '15201297871'],
['黄博涛', '15726940779'],
['刘尖学', '18367117637'],
['蒋佳杰', '15957195421']]
token = '903ab8b3ba3d46e7c8b934ef83038bd6037e56c04a985e43fab8f2e0bd359cad'
secret = 'SEC7e57fbdd5b20103208482f520420139072d84c754a3cd624641623bd2f225af3'
# 获取当天日期
currentdate = datetime.date.today()
currentday = calendar.weekday(currentdate.year, currentdate.month, currentdate.day)
text = '@'+zhibanren[currentday][1]+',值班同学辛苦啦~ ' \
'\n> 不要忘记发值班日报并记录值班问题哦~ [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=99955951) '
at = {'atMobiles': [zhibanren[currentday][1]]}
Remind.send_markdown(token, secret, '值班提醒', text, at)
......@@ -25,7 +25,4 @@ content1 = "请及时上传测试用例:http://cf.dui88.com/pages/viewpage.act
content2 = "bug请及时上报jira并更新状态:http://jira.dui88.com"
content3 = "业务文档请及时更新:http://cf.dui88.com/pages/viewpage.action?pageId=78912619"
# 发送信息
# DDMessage.send_message(fullUrl,content1)
# DDMessage.send_message(fullUrl,content2)
# DDMessage.send_message(fullUrl,content3)
DDMessage.send_message(fullUrl,content1+'\n'+content3)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment