Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull from remote #487

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dailycheckin/configs.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def checkin_map():
"NTFY_URL": "",
"NTFY_TOPIC": "",
"NTFY_PRIORITY": "",
"JENKINS_TOKEN": "",
"JENKINS_URL": ""
}


Expand Down
16 changes: 15 additions & 1 deletion dailycheckin/utils/message.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import re
import time
from urllib.parse import quote_plus
from urllib.parse import quote_plus,quote

import requests

Expand All @@ -28,6 +28,13 @@ def message2server_turbo(sendkey, content):
requests.post(url=url, data=data)
return

def send2jenkins(url, token, content):
print("send to jenkins")
token=quote(token)
url = f"{url}&token={token}&text={content}"
response = requests.get(url)
print(response.content)
return

def message2coolpush(
coolpushskey,
Expand Down Expand Up @@ -294,6 +301,8 @@ def push_message(content_list: list, notice_info: dict):
ntfy_priority = notice_info.get("ntfy_priority")
content_str = "\n————————————\n\n".join(content_list)
merge_push = notice_info.get("merge_push")
jenkins_url = notice_info.get("jenkins_url")
jenkins_token = notice_info.get("jenkins_token")
message_list = [content_str]
try:
notice = important_notice()
Expand All @@ -320,6 +329,11 @@ def push_message(content_list: list, notice_info: dict):
if not merge_push:
message_list = content_list
for message in message_list:
if jenkins_token:
try:
send2jenkins(jenkins_url, jenkins_token, message)
except Exception as e:
print("send to jenkins error", e)
if qmsg_key:
try:
message2qmsg(qmsg_key=qmsg_key, qmsg_type=qmsg_type, content=message)
Expand Down