You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
2.0 KiB
63 lines
2.0 KiB
import json
|
|
import sys
|
|
|
|
import requests
|
|
|
|
webhook_url = "https://open.feishu.cn/open-apis/bot/v2/hook/748fc2e7-3852-4937-8025-c3973183ac8d"
|
|
Version = ""
|
|
|
|
|
|
if __name__ == '__main__':
|
|
Version = sys.argv[1]
|
|
Result = sys.argv[2]
|
|
print(f"Version is {Version}")
|
|
succeed_message = {
|
|
"msg_type": "post",
|
|
"content": {
|
|
"post": {
|
|
"zh_cn": {
|
|
"title": "客户端minigame jenkins出包通知",
|
|
"content": [
|
|
[
|
|
{
|
|
"tag": "text",
|
|
"text": f"结果:成功!\n",
|
|
},
|
|
{
|
|
"tag": "a",
|
|
"text": f"点击可以查看预览二维码:{Version}",
|
|
"href": f"http://10.0.22.46:8001/{Version}.destination.jpg"
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
failed_message = {
|
|
"msg_type": "post",
|
|
"content": {
|
|
"post": {
|
|
"zh_cn": {
|
|
"title": "客户端minigame jenkins出包通知",
|
|
"content": [
|
|
[
|
|
{
|
|
"tag": "text",
|
|
"text": f"结果:失败!\n",
|
|
},
|
|
{
|
|
"tag": "text",
|
|
"text": f"请检查打包工程",
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if Result == "true":
|
|
response = requests.post(webhook_url, headers={"Content-Type": "application/json"}, data=json.dumps(succeed_message))
|
|
elif Result == "false":
|
|
response = requests.post(webhook_url, headers={"Content-Type": "application/json"}, data=json.dumps(failed_message))
|
|
|
|
|