Compare commits
14 Commits
b9a2ab5509
...
prod
| Author | SHA1 | Date | |
|---|---|---|---|
| bfe281fb05 | |||
| f8b700b982 | |||
| c96ad735d7 | |||
| ce266c879c | |||
| ddb8b97fd4 | |||
| e014b1f526 | |||
| 4bffbaa71c | |||
| f1b57abeca | |||
| d756179afc | |||
| eec0828dda | |||
| 2a30408bf0 | |||
| 5275687b26 | |||
| ff45d77f44 | |||
| 0948519267 |
@@ -8,15 +8,15 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- common-infra-nginx-development
|
- common-infra-nginx-development
|
||||||
- configurator-development
|
- configurator-development
|
||||||
|
- postgres-development
|
||||||
|
- minio-development
|
||||||
environment:
|
environment:
|
||||||
DB_HOST: "pg.develop.sprinthub.ru"
|
DB_HOST: "postgres"
|
||||||
DB_PASSWORD: $DB_PASSWORD_DEV
|
DB_PASSWORD: $DB_PASSWORD_DEV
|
||||||
MINIO_HOST: "minio.develop.sprinthub.ru"
|
MINIO_HOST: "minio"
|
||||||
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
|
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
|
||||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
REDIS_HOST: "redis.dev.chocomarsh.com"
|
||||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||||
RABBITMQ_HOST: "rabbitmq.develop.sprinthub.ru"
|
|
||||||
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
|
||||||
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
|
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
|
||||||
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
|
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
|
||||||
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
|
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
|
||||||
@@ -37,15 +37,16 @@ services:
|
|||||||
|
|
||||||
fetch_stats:
|
fetch_stats:
|
||||||
image: mathwave/sprint-repo:platform
|
image: mathwave/sprint-repo:platform
|
||||||
|
networks:
|
||||||
|
- postgres-development
|
||||||
|
- minio-development
|
||||||
environment:
|
environment:
|
||||||
DB_HOST: "pg.develop.sprinthub.ru"
|
DB_HOST: "postgres"
|
||||||
DB_PASSWORD: $DB_PASSWORD_DEV
|
DB_PASSWORD: $DB_PASSWORD_DEV
|
||||||
MINIO_HOST: "minio.develop.sprinthub.ru"
|
MINIO_HOST: "minio"
|
||||||
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
|
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
|
||||||
REDIS_HOST: "redis.develop.sprinthub.ru"
|
REDIS_HOST: "redis.dev.chocomarsh.com"
|
||||||
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||||
RABBITMQ_HOST: "rabbitmq.develop.sprinthub.ru"
|
|
||||||
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD_DEV
|
|
||||||
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
|
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
|
||||||
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
|
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
|
||||||
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
|
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
|
||||||
@@ -60,11 +61,19 @@ services:
|
|||||||
|
|
||||||
migrate:
|
migrate:
|
||||||
image: mathwave/sprint-repo:platform
|
image: mathwave/sprint-repo:platform
|
||||||
|
networks:
|
||||||
|
- postgres-development
|
||||||
|
- minio-development
|
||||||
environment:
|
environment:
|
||||||
DB_HOST: "pg.develop.sprinthub.ru"
|
DB_HOST: "postgres"
|
||||||
DB_PASSWORD: $DB_PASSWORD_DEV
|
DB_PASSWORD: $DB_PASSWORD_DEV
|
||||||
MINIO_HOST: "minio.develop.sprinthub.ru"
|
MINIO_HOST: "minio"
|
||||||
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
|
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_DEV
|
||||||
|
REDIS_HOST: "redis.dev.chocomarsh.com"
|
||||||
|
REDIS_PASSWORD: $REDIS_PASSWORD_DEV
|
||||||
|
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
|
||||||
|
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
|
||||||
|
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
|
||||||
command: migrate
|
command: migrate
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -79,3 +88,7 @@ networks:
|
|||||||
external: true
|
external: true
|
||||||
configurator-development:
|
configurator-development:
|
||||||
external: true
|
external: true
|
||||||
|
postgres-development:
|
||||||
|
external: true
|
||||||
|
minio-development:
|
||||||
|
external: true
|
||||||
|
|||||||
@@ -8,14 +8,16 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- common-infra-nginx
|
- common-infra-nginx
|
||||||
- configurator
|
- configurator
|
||||||
|
- postgres
|
||||||
|
- minio
|
||||||
environment:
|
environment:
|
||||||
DB_HOST: "pg.sprinthub.ru"
|
DB_HOST: "postgres"
|
||||||
DB_PASSWORD: $DB_PASSWORD_PROD
|
DB_PASSWORD: $DB_PASSWORD_PROD
|
||||||
MINIO_HOST: "minio.sprinthub.ru"
|
MINIO_HOST: "minio"
|
||||||
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_PROD
|
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_PROD
|
||||||
REDIS_HOST: "redis.sprinthub.ru"
|
REDIS_HOST: "redis.chocomarsh.com"
|
||||||
REDIS_PASSWORD: $REDIS_PASSWORD_PROD
|
REDIS_PASSWORD: $REDIS_PASSWORD_PROD
|
||||||
RABBITMQ_HOST: "rabbitmq.sprinthub.ru"
|
RABBITMQ_HOST: "rabbitmq.chocomarsh.com"
|
||||||
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD_PROD
|
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD_PROD
|
||||||
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
|
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
|
||||||
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
|
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
|
||||||
@@ -37,14 +39,17 @@ services:
|
|||||||
|
|
||||||
fetch_stats:
|
fetch_stats:
|
||||||
image: mathwave/sprint-repo:platform
|
image: mathwave/sprint-repo:platform
|
||||||
|
networks:
|
||||||
|
- postgres
|
||||||
|
- minio
|
||||||
environment:
|
environment:
|
||||||
DB_HOST: "pg.sprinthub.ru"
|
DB_HOST: "postgres"
|
||||||
DB_PASSWORD: $DB_PASSWORD_PROD
|
DB_PASSWORD: $DB_PASSWORD_PROD
|
||||||
MINIO_HOST: "minio.sprinthub.ru"
|
MINIO_HOST: "minio"
|
||||||
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_PROD
|
MINIO_SECRET_KEY: $MINIO_SECRET_KEY_PROD
|
||||||
REDIS_HOST: "redis.sprinthub.ru"
|
REDIS_HOST: "redis.chocomarsh.com"
|
||||||
REDIS_PASSWORD: $REDIS_PASSWORD_PROD
|
REDIS_PASSWORD: $REDIS_PASSWORD_PROD
|
||||||
RABBITMQ_HOST: "rabbitmq.sprinthub.ru"
|
RABBITMQ_HOST: "rabbitmq.chocomarsh.com"
|
||||||
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD_PROD
|
RABBITMQ_PASSWORD: $RABBITMQ_PASSWORD_PROD
|
||||||
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
|
VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN
|
||||||
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
|
YANDEX_SERVICE_TOKEN: $YANDEX_SERVICE_TOKEN
|
||||||
@@ -60,10 +65,13 @@ services:
|
|||||||
|
|
||||||
migrate:
|
migrate:
|
||||||
image: mathwave/sprint-repo:platform
|
image: mathwave/sprint-repo:platform
|
||||||
|
networks:
|
||||||
|
- postgres
|
||||||
|
- minio
|
||||||
environment:
|
environment:
|
||||||
DB_HOST: "pg.sprinthub.ru"
|
DB_HOST: "postgres"
|
||||||
DB_PASSWORD: $DB_PASSWORD_PROD
|
DB_PASSWORD: $DB_PASSWORD_PROD
|
||||||
MINIO_HOST: "minio.sprinthub.ru"
|
MINIO_HOST: "minio"
|
||||||
MINIO_SECRET_KEY: $MINIO _SECRET_KEY_PROD
|
MINIO_SECRET_KEY: $MINIO _SECRET_KEY_PROD
|
||||||
command: migrate
|
command: migrate
|
||||||
deploy:
|
deploy:
|
||||||
@@ -79,3 +87,7 @@ networks:
|
|||||||
external: true
|
external: true
|
||||||
configurator:
|
configurator:
|
||||||
external: true
|
external: true
|
||||||
|
postgres:
|
||||||
|
external: true
|
||||||
|
minio:
|
||||||
|
external: true
|
||||||
|
|||||||
37
generator.py
Normal file
37
generator.py
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import json
|
||||||
|
import urllib.request
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
|
projects = {
|
||||||
|
'queues': 'tasks.proto'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
shutil.rmtree('schemas')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
os.mkdir('schemas')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
for project in projects:
|
||||||
|
response = urllib.request.urlopen(f'https://platform.sprinthub.ru/schemas/get?project={project}').read()
|
||||||
|
data = json.loads(response)
|
||||||
|
os.mkdir(f'schemas/{project}')
|
||||||
|
for key, value in data.items():
|
||||||
|
with open(f'schemas/{project}/{key}', 'w+') as fp:
|
||||||
|
fp.write(value)
|
||||||
|
|
||||||
|
|
||||||
|
for key, value in projects.items():
|
||||||
|
os.system(f'python -m grpc_tools.protoc --proto_path schemas --python_out=. --pyi_out=. --grpc_python_out=. ./schemas/{key}/{value}')
|
||||||
|
|
||||||
|
try:
|
||||||
|
shutil.rmtree('schemas')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
@@ -15,4 +15,5 @@ urlpatterns = [
|
|||||||
path(*YandexAuthView.as_path()),
|
path(*YandexAuthView.as_path()),
|
||||||
path('is_staff', is_staff),
|
path('is_staff', is_staff),
|
||||||
path('fetch', fetch),
|
path('fetch', fetch),
|
||||||
|
path('generator', generator),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -9,3 +9,4 @@ from .vk_auth import VKAuthView
|
|||||||
from .yandex_auth import YandexAuthView
|
from .yandex_auth import YandexAuthView
|
||||||
from .is_staff import is_staff
|
from .is_staff import is_staff
|
||||||
from .fetch import fetch
|
from .fetch import fetch
|
||||||
|
from .generator import generator
|
||||||
|
|||||||
5
web/views/generator.py
Normal file
5
web/views/generator.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
from django.http import HttpResponse
|
||||||
|
|
||||||
|
|
||||||
|
def generator(request):
|
||||||
|
return HttpResponse(open('generator.py', 'rb').read())
|
||||||
Reference in New Issue
Block a user