remove test
This commit is contained in:
parent
3608c3ec65
commit
e1e647f1b9
|
@ -0,0 +1 @@
|
||||||
|
WEBHOOK='https://crm.svs-tech.pro/rest/38/7ufrqnfpncmt279p'
|
|
@ -1,5 +1,5 @@
|
||||||
|
import os
|
||||||
import logging
|
import logging
|
||||||
import uuid
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
@ -9,3 +9,5 @@ logging.basicConfig(
|
||||||
)
|
)
|
||||||
logging.getLogger("httpx").setLevel(logging.WARNING)
|
logging.getLogger("httpx").setLevel(logging.WARNING)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
WEBHOOK = os.getenv('WEBHOOK')
|
|
@ -2,7 +2,7 @@ import requests
|
||||||
import json
|
import json
|
||||||
from fastapi import FastAPI, Request
|
from fastapi import FastAPI, Request
|
||||||
|
|
||||||
from app.constants import logger
|
from app.constants import logger, WEBHOOK
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
|
@ -21,9 +21,6 @@ async def intgr(request: Request):
|
||||||
[tag, number, *args] = branch.split("-")
|
[tag, number, *args] = branch.split("-")
|
||||||
logger.info(f"input tag {tag} number {number} args {args}")
|
logger.info(f"input tag {tag} number {number} args {args}")
|
||||||
|
|
||||||
if number == "test":
|
|
||||||
number = 423
|
|
||||||
|
|
||||||
bx_comment = (
|
bx_comment = (
|
||||||
f"Сообщение от GITEA для задачи {number} (ветка {body['ref']} в репозитории {body['repository']['full_name']})"
|
f"Сообщение от GITEA для задачи {number} (ветка {body['ref']} в репозитории {body['repository']['full_name']})"
|
||||||
"\n\n"
|
"\n\n"
|
||||||
|
@ -31,7 +28,7 @@ async def intgr(request: Request):
|
||||||
)
|
)
|
||||||
|
|
||||||
bx_res = requests.get(
|
bx_res = requests.get(
|
||||||
"https://crm.svs-tech.pro/rest/38/7ufrqnfpncmt279p/task.commentitem.add.json?"
|
f"{WEBHOOK}/task.commentitem.add.json?"
|
||||||
f"taskId={number}"
|
f"taskId={number}"
|
||||||
f"&fields[POST_MESSAGE]={bx_comment}"
|
f"&fields[POST_MESSAGE]={bx_comment}"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue