Compare commits

..

5 Commits

Author SHA1 Message Date
adc2525fab Merge pull request 'master' (#23) from master into prod
Reviewed-on: #23
2024-11-24 23:50:29 +03:00
8a4a6ac217 fix
All checks were successful
Deploy Prod / Build (pull_request) Successful in 4s
Deploy Prod / Push (pull_request) Successful in 7s
Deploy Prod / Deploy prod (pull_request) Successful in 14s
2024-11-24 18:10:34 +03:00
3d379bc6d7 configurator
All checks were successful
Deploy Dev / Build (pull_request) Successful in 5s
Deploy Dev / Push (pull_request) Successful in 8s
Deploy Dev / Deploy dev (pull_request) Successful in 14s
2024-11-24 18:05:52 +03:00
443b943bee Merge branch 'master' of https://gitea.sprinthub.ru/self/pizda-bot
All checks were successful
Deploy Dev / Build (pull_request) Successful in 5s
Deploy Dev / Push (pull_request) Successful in 8s
Deploy Dev / Deploy dev (pull_request) Successful in 14s
2024-11-23 22:37:50 +03:00
1d543461e9 fix 2024-11-23 22:36:58 +03:00
4 changed files with 16 additions and 15 deletions

View File

@ -10,7 +10,7 @@ services:
TELEGRAM_TOKEN: $TELEGRAM_TOKEN_DEV TELEGRAM_TOKEN: $TELEGRAM_TOKEN_DEV
STAGE: "development" STAGE: "development"
networks: networks:
- queues - queues-development
deploy: deploy:
mode: replicated mode: replicated
restart_policy: restart_policy:
@ -26,9 +26,9 @@ services:
MONGO_HOST: "mongo.develop.sprinthub.ru" MONGO_HOST: "mongo.develop.sprinthub.ru"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV MONGO_PASSWORD: $MONGO_PASSWORD_DEV
STAGE: "development" STAGE: "development"
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
networks: networks:
- queues - queues-development
- configurator
deploy: deploy:
mode: replicated mode: replicated
restart_policy: restart_policy:
@ -44,7 +44,7 @@ services:
TELEGRAM_TOKEN: $TELEGRAM_TOKEN_DEV TELEGRAM_TOKEN: $TELEGRAM_TOKEN_DEV
STAGE: "development" STAGE: "development"
networks: networks:
- queues - queues-development
deploy: deploy:
mode: replicated mode: replicated
restart_policy: restart_policy:
@ -63,7 +63,7 @@ services:
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
STAGE: "development" STAGE: "development"
networks: networks:
- common-infra-nginx - common-infra-nginx-development
deploy: deploy:
mode: replicated mode: replicated
restart_policy: restart_policy:
@ -73,7 +73,9 @@ services:
order: start-first order: start-first
networks: networks:
common-infra-nginx: common-infra-nginx-development:
external: true external: true
queues: queues-development:
external: true
configurator:
external: true external: true

View File

@ -29,6 +29,7 @@ services:
PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN PLATFORM_SECURITY_TOKEN: $PLATFORM_SECURITY_TOKEN
networks: networks:
- queues - queues
- configurator
deploy: deploy:
mode: replicated mode: replicated
restart_policy: restart_policy:
@ -77,3 +78,5 @@ networks:
external: true external: true
queues: queues:
external: true external: true
configurator:
external: true

View File

@ -28,7 +28,7 @@ jobs:
run: docker push mathwave/sprint-repo:pizda-bot run: docker push mathwave/sprint-repo:pizda-bot
deploy-dev: deploy-dev:
name: Deploy dev name: Deploy dev
runs-on: [dev] runs-on: [prod]
needs: push needs: push
steps: steps:
- name: login - name: login
@ -42,4 +42,4 @@ jobs:
TELEGRAM_TOKEN_DEV: ${{ secrets.TELEGRAM_TOKEN_DEV }} TELEGRAM_TOKEN_DEV: ${{ secrets.TELEGRAM_TOKEN_DEV }}
MONGO_PASSWORD_DEV: ${{ secrets.MONGO_PASSWORD_DEV }} MONGO_PASSWORD_DEV: ${{ secrets.MONGO_PASSWORD_DEV }}
PLATFORM_SECURITY_TOKEN: ${{ secrets.PLATFORM_SECURITY_TOKEN }} PLATFORM_SECURITY_TOKEN: ${{ secrets.PLATFORM_SECURITY_TOKEN }}
run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml pizda-bot run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml pizda-bot-development

View File

@ -14,11 +14,8 @@ class PlatformClient:
self.stage = stage self.stage = stage
self.configs = configs self.configs = configs
self.experiments = experiments self.experiments = experiments
self.endpoint = 'https://platform.sprinthub.ru/' self.endpoint = 'http://configurator/'
self.configs_url = urllib.parse.urljoin(self.endpoint, 'configs/get') self.fetch_url = urllib.parse.urljoin(self.endpoint, '/api/v1/fetch')
self.experiments_url = urllib.parse.urljoin(self.endpoint, 'experiments/get')
self.staff_url = urllib.parse.urljoin(self.endpoint, 'is_staff')
self.fetch_url = urllib.parse.urljoin(self.endpoint, 'fetch')
self.config_storage = {} self.config_storage = {}
self.experiment_storage = {} self.experiment_storage = {}
self.staff_storage = {} self.staff_storage = {}
@ -43,7 +40,6 @@ class PlatformClient:
try: try:
response = get( response = get(
url, url,
headers={'X-Security-Token': self.platform_security_token},
params=params params=params
) )
if response.status_code == 200: if response.status_code == 200: