mirror of
https://github.com/Balshgit/different
synced 2025-09-11 02:50:41 +03:00
Compare commits
2 Commits
0553e40711
...
8a23510095
Author | SHA1 | Date | |
---|---|---|---|
8a23510095 | |||
9e71c4cb53 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -221,8 +221,8 @@ media/
|
|||||||
|
|
||||||
|
|
||||||
# Configuration file with private data:
|
# Configuration file with private data:
|
||||||
# *.env
|
*.env
|
||||||
# .env
|
.env
|
||||||
|
|
||||||
# Local settings files:
|
# Local settings files:
|
||||||
*local.py
|
*local.py
|
||||||
|
1
get-gitlab-projects/get_project_core/.gitignore
vendored
Normal file
1
get-gitlab-projects/get_project_core/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.env
|
4
get-gitlab-projects/get_project_core/__init__.py
Normal file
4
get-gitlab-projects/get_project_core/__init__.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import requests
|
||||||
|
from requests.packages.urllib3.exceptions import InsecureRequestWarning
|
||||||
|
|
||||||
|
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
|
30
get-gitlab-projects/get_project_core/settings.py
Normal file
30
get-gitlab-projects/get_project_core/settings.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import importlib.util
|
||||||
|
import logging
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from decouple import AutoConfig
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
current_dir = Path(__file__).parent.parent
|
||||||
|
config = AutoConfig(search_path=current_dir.joinpath('get_project_core'))
|
||||||
|
|
||||||
|
|
||||||
|
# use loguru if it is possible for color output
|
||||||
|
if importlib.util.find_spec('loguru') is not None:
|
||||||
|
from loguru import logger
|
||||||
|
logger.remove()
|
||||||
|
logger.add(sink=sys.stdout, colorize=True, level='DEBUG',
|
||||||
|
format="<cyan>{time:DD.MM.YYYY HH:mm:ss}</cyan> | <level>{level}</level> | "
|
||||||
|
"<magenta>{message}</magenta>")
|
||||||
|
|
||||||
|
# use standard logging
|
||||||
|
else:
|
||||||
|
logger = logging.getLogger()
|
||||||
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
|
console_handler = logging.StreamHandler()
|
||||||
|
console_handler.setLevel(logging.INFO)
|
||||||
|
log_formatter = logging.Formatter("%(asctime)s | %(levelname)s | %(message)s")
|
||||||
|
console_handler.setFormatter(log_formatter)
|
||||||
|
|
||||||
|
logger.addHandler(console_handler)
|
3
get-gitlab-projects/get_project_core/update-repos.sh
Executable file
3
get-gitlab-projects/get_project_core/update-repos.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
git pull --all
|
40
get-gitlab-projects/get_projects.py
Normal file
40
get-gitlab-projects/get_projects.py
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import json # noqa # pylint: disable=unused-import
|
||||||
|
import subprocess
|
||||||
|
import time
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
from get_project_core.settings import logger, config, current_dir
|
||||||
|
|
||||||
|
headers = {'PRIVATE-TOKEN': config('X5_SCM_TOKEN', cast=str)}
|
||||||
|
|
||||||
|
|
||||||
|
def create_repositories(group_id: int):
|
||||||
|
"""
|
||||||
|
Create submodules from gitlab group
|
||||||
|
|
||||||
|
:param group_id: Can be find under group name
|
||||||
|
"""
|
||||||
|
request = requests.get(f'https://scm.x5.ru/api/v4/groups/{group_id}/projects', headers=headers, verify=False)
|
||||||
|
# logger.info(f'{json.dumps(request.json(), indent=4, separators=(",", ":"))}')
|
||||||
|
|
||||||
|
repos = request.json()
|
||||||
|
|
||||||
|
for repo in repos:
|
||||||
|
name = str(repo.get("ssh_url_to_repo", None)).strip()
|
||||||
|
subprocess.Popen(['git', 'submodule', 'add', name])
|
||||||
|
logger.info(f'Created: {name}')
|
||||||
|
time.sleep(15)
|
||||||
|
|
||||||
|
|
||||||
|
def update_submodules():
|
||||||
|
"""
|
||||||
|
Update all submodules
|
||||||
|
|
||||||
|
"""
|
||||||
|
subprocess.Popen(['git', 'submodule', 'foreach', f'{current_dir}/get-project-core/update-repos.sh'])
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
create_repositories(group_id=3574)
|
||||||
|
# update_submodules()
|
159
requiremetns.txt
Normal file
159
requiremetns.txt
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
aiohttp==3.8.1
|
||||||
|
aiosignal==1.2.0
|
||||||
|
alembic==1.7.6
|
||||||
|
altgraph==0.17.2
|
||||||
|
anyio==3.5.0
|
||||||
|
arrow==1.2.2
|
||||||
|
asgiref==3.5.0
|
||||||
|
asttokens==2.0.5
|
||||||
|
async-generator==1.10
|
||||||
|
async-timeout==4.0.2
|
||||||
|
attrs==21.4.0
|
||||||
|
Babel==2.9.1
|
||||||
|
backcall==0.2.0
|
||||||
|
backports.entry-points-selectable==1.1.1
|
||||||
|
bcrypt==3.2.0
|
||||||
|
bidict==0.21.4
|
||||||
|
binaryornot==0.4.4
|
||||||
|
black==22.1.0
|
||||||
|
blinker==1.4
|
||||||
|
Brotli==1.0.9
|
||||||
|
CacheControl==0.12.10
|
||||||
|
cachy==0.3.0
|
||||||
|
certifi==2021.10.8
|
||||||
|
cffi==1.15.0
|
||||||
|
chardet==4.0.0
|
||||||
|
charset-normalizer==2.0.12
|
||||||
|
cleo==0.8.1
|
||||||
|
click==8.0.4
|
||||||
|
clikit==0.6.2
|
||||||
|
cookiecutter==1.7.3
|
||||||
|
coverage==6.3.2
|
||||||
|
crashtest==0.3.1
|
||||||
|
cryptography==36.0.1
|
||||||
|
decorator==5.1.1
|
||||||
|
distlib==0.3.4
|
||||||
|
Django==4.0.3
|
||||||
|
dnspython==2.2.0
|
||||||
|
email-validator==1.1.3
|
||||||
|
executing==0.8.3
|
||||||
|
fastapi==0.74.1
|
||||||
|
filelock==3.6.0
|
||||||
|
Flask==2.0.3
|
||||||
|
Flask-Login==0.5.0
|
||||||
|
Flask-Principal==0.4.0
|
||||||
|
Flask-SQLAlchemy==2.5.1
|
||||||
|
Flask-WTF==1.0.0
|
||||||
|
frozenlist==1.3.0
|
||||||
|
greenlet==1.1.2
|
||||||
|
h11==0.13.0
|
||||||
|
html5lib==1.1
|
||||||
|
idna==3.3
|
||||||
|
importlib-metadata==4.11.2
|
||||||
|
iniconfig==1.1.1
|
||||||
|
ipython==8.1.0
|
||||||
|
itsdangerous==2.1.0
|
||||||
|
jedi==0.18.1
|
||||||
|
jeepney==0.7.1
|
||||||
|
Jinja2==3.0.3
|
||||||
|
jinja2-time==0.2.0
|
||||||
|
keyring==23.5.0
|
||||||
|
lockfile==0.12.2
|
||||||
|
loguru==0.6.0
|
||||||
|
Mako==1.1.6
|
||||||
|
MarkupSafe==2.1.0
|
||||||
|
matplotlib-inline==0.1.3
|
||||||
|
MouseInfo==0.1.3
|
||||||
|
msgpack==1.0.3
|
||||||
|
multidict==6.0.2
|
||||||
|
mypy==0.931
|
||||||
|
mypy-extensions==0.4.3
|
||||||
|
outcome==1.1.0
|
||||||
|
packaging==21.3
|
||||||
|
paramiko==2.9.2
|
||||||
|
parso==0.8.3
|
||||||
|
passlib==1.7.4
|
||||||
|
pastel==0.2.1
|
||||||
|
pathspec==0.9.0
|
||||||
|
pexpect==4.8.0
|
||||||
|
pickleshare==0.7.5
|
||||||
|
Pillow==9.0.1
|
||||||
|
pkginfo==1.8.2
|
||||||
|
platformdirs==2.5.1
|
||||||
|
pluggy==1.0.0
|
||||||
|
poetry==1.1.13
|
||||||
|
poetry-core==1.0.8
|
||||||
|
poyo==0.5.0
|
||||||
|
prompt-toolkit==3.0.28
|
||||||
|
psycopg2-binary==2.9.3
|
||||||
|
ptyprocess==0.7.0
|
||||||
|
pure-eval==0.2.2
|
||||||
|
py==1.11.0
|
||||||
|
pyasn1==0.4.8
|
||||||
|
PyAutoGUI==0.9.53
|
||||||
|
pycparser==2.21
|
||||||
|
pydantic==1.9.0
|
||||||
|
PyGetWindow==0.0.9
|
||||||
|
Pygments==2.11.2
|
||||||
|
pyinstaller==4.9
|
||||||
|
pyinstaller-hooks-contrib==2022.2
|
||||||
|
pylev==1.4.0
|
||||||
|
PyMsgBox==1.0.9
|
||||||
|
PyNaCl==1.5.0
|
||||||
|
pyOpenSSL==22.0.0
|
||||||
|
pyparsing==3.0.7
|
||||||
|
pyperclip==1.8.2
|
||||||
|
PyQt6==6.2.3
|
||||||
|
PyQt6-Qt6==6.2.3
|
||||||
|
PyQt6-sip==13.2.1
|
||||||
|
PyRect==0.1.4
|
||||||
|
PyScreeze==0.1.28
|
||||||
|
PySocks==1.7.1
|
||||||
|
pytest==7.0.1
|
||||||
|
pytest-cov==3.0.0
|
||||||
|
python-dateutil==2.8.2
|
||||||
|
python-decouple==3.6
|
||||||
|
python-dotenv==0.19.2
|
||||||
|
python-engineio==4.3.1
|
||||||
|
python-slugify==6.1.1
|
||||||
|
python-socketio==5.5.2
|
||||||
|
python3-xlib==0.15
|
||||||
|
pytweening==1.0.4
|
||||||
|
pytz==2021.3
|
||||||
|
qt6-applications==6.1.0.2.2
|
||||||
|
qt6-tools==6.1.0.1.2
|
||||||
|
requests==2.27.1
|
||||||
|
requests-toolbelt==0.9.1
|
||||||
|
SecretStorage==3.3.1
|
||||||
|
selenium==4.1.2
|
||||||
|
shellingham==1.4.0
|
||||||
|
simplejson==3.17.6
|
||||||
|
six==1.16.0
|
||||||
|
sniffio==1.2.0
|
||||||
|
sortedcontainers==2.4.0
|
||||||
|
speaklater==1.3
|
||||||
|
speaklater3==1.4
|
||||||
|
SQLAlchemy==1.4.31
|
||||||
|
sqlparse==0.4.2
|
||||||
|
sshtunnel==0.4.0
|
||||||
|
stack-data==0.2.0
|
||||||
|
starlette==0.18.0
|
||||||
|
style==1.1.6
|
||||||
|
text-unidecode==1.3
|
||||||
|
tomli==2.0.1
|
||||||
|
tomlkit==0.10.0
|
||||||
|
traitlets==5.1.1
|
||||||
|
trio==0.20.0
|
||||||
|
trio-websocket==0.9.2
|
||||||
|
typing_extensions==4.1.1
|
||||||
|
ua-parser==0.10.0
|
||||||
|
urllib3==1.26.8
|
||||||
|
user-agents==2.2.0
|
||||||
|
virtualenv==20.13.2
|
||||||
|
wcwidth==0.2.5
|
||||||
|
webencodings==0.5.1
|
||||||
|
Werkzeug==2.0.3
|
||||||
|
wsproto==1.1.0
|
||||||
|
WTForms==3.0.1
|
||||||
|
yarl==1.7.2
|
||||||
|
zipp==3.7.0
|
Loading…
x
Reference in New Issue
Block a user