mirror of
https://github.com/Balshgit/github_mirror.git
synced 2026-02-03 11:20:57 +03:00
change git domain to ru
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from argparse import ArgumentParser
|
||||
|
||||
GIT_URL = 'https://git.mywistr.com'
|
||||
GIT_URL = 'https://git.mywistr.ru'
|
||||
|
||||
USAGE = '''github_mirror [-h] [-g GROUP] (-u URLS [URLS ...] | -f FILE) -t TOKEN [-T GitHubTOKEN]
|
||||
--------------------------------------------------
|
||||
|
||||
@@ -9,13 +9,13 @@ from core.utils import logger
|
||||
|
||||
class RepositoryCreator:
|
||||
|
||||
def __init__(self, gitlab_url: str, headers: dict):
|
||||
self.gitlab_url = gitlab_url
|
||||
def __init__(self, git_url: str, headers: dict):
|
||||
self.git_url = git_url
|
||||
self.headers = headers
|
||||
self.HTTP_201_CREATED = 201
|
||||
self.HTTP_200_OK = 200
|
||||
|
||||
def __gitlab_request(self, method: str, url: str, data: dict = None) -> Union[Response, None]:
|
||||
def __git_request(self, method: str, url: str, data: dict = None) -> Union[Response, None]:
|
||||
"""
|
||||
Create request to gitlab
|
||||
|
||||
@@ -51,7 +51,7 @@ class RepositoryCreator:
|
||||
if auth_token:
|
||||
git_data['auth_token'] = auth_token
|
||||
|
||||
request = self.__gitlab_request('POST', f'{self.gitlab_url}/api/v1/repos/migrate', git_data)
|
||||
request = self.__git_request('POST', f'{self.git_url}/api/v1/repos/migrate', git_data)
|
||||
try:
|
||||
if request.status_code == self.HTTP_201_CREATED:
|
||||
repo_data = request.json()
|
||||
|
||||
Reference in New Issue
Block a user