fix
This commit is contained in:
parent
942efb8036
commit
dd2bcff3d7
47
.gitea/workflows/deploy-dev.yaml
Normal file
47
.gitea/workflows/deploy-dev.yaml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
name: Deploy Dev
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
types: [closed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: [ dev ]
|
||||||
|
steps:
|
||||||
|
- name: login
|
||||||
|
run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: dev
|
||||||
|
- name: build
|
||||||
|
run: docker build -t mathwave/sprint-repo:roulette-bot .
|
||||||
|
push:
|
||||||
|
name: Push
|
||||||
|
runs-on: [ dev ]
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: push
|
||||||
|
run: docker push mathwave/sprint-repo:roulette-bot
|
||||||
|
deploy-dev:
|
||||||
|
name: Deploy dev
|
||||||
|
runs-on: [dev]
|
||||||
|
needs: push
|
||||||
|
steps:
|
||||||
|
- name: login
|
||||||
|
run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: dev
|
||||||
|
- name: deploy
|
||||||
|
env:
|
||||||
|
TELEGRAM_TOKEN_DEV: ${{ secrets.TELEGRAM_TOKEN_DEV }}
|
||||||
|
MONGO_PASSWORD_DEV: ${{ secrets.MONGO_PASSWORD_DEV }}
|
||||||
|
PLATFORM_SECURITY_TOKEN: ${{ secrets.PLATFORM_SECURITY_TOKEN }}
|
||||||
|
MINIO_SECRET_KEY_DEV: ${{ secrets.MINIO_SECRET_KEY_DEV }}
|
||||||
|
REDIS_PASSWORD_DEV: ${{ secrets.REDIS_PASSWORD_DEV }}
|
||||||
|
run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml roulette-bot
|
47
.gitea/workflows/deploy-prod.yaml
Normal file
47
.gitea/workflows/deploy-prod.yaml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
name: Deploy Prod
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- prod
|
||||||
|
types: [closed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: [ dev ]
|
||||||
|
steps:
|
||||||
|
- name: login
|
||||||
|
run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: prod
|
||||||
|
- name: build
|
||||||
|
run: docker build -t mathwave/sprint-repo:roulette-bot .
|
||||||
|
push:
|
||||||
|
name: Push
|
||||||
|
runs-on: [ dev ]
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: push
|
||||||
|
run: docker push mathwave/sprint-repo:roulette-bot
|
||||||
|
deploy-prod:
|
||||||
|
name: Deploy prod
|
||||||
|
runs-on: [prod]
|
||||||
|
needs: push
|
||||||
|
steps:
|
||||||
|
- name: login
|
||||||
|
run: docker login -u mathwave -p ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: prod
|
||||||
|
- name: deploy
|
||||||
|
env:
|
||||||
|
TELEGRAM_TOKEN_PROD: ${{ secrets.TELEGRAM_TOKEN_PROD }}
|
||||||
|
MONGO_PASSWORD_PROD: ${{ secrets.MONGO_PASSWORD_PROD }}
|
||||||
|
PLATFORM_SECURITY_TOKEN: ${{ secrets.PLATFORM_SECURITY_TOKEN }}
|
||||||
|
MINIO_SECRET_KEY_PROD: ${{ secrets.MINIO_SECRET_KEY_PROD }}
|
||||||
|
REDIS_PASSWORD_PROD: ${{ secrets.REDIS_PASSWORD_PROD }}
|
||||||
|
run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-prod.yaml roulette-bot
|
4
bot.py
4
bot.py
@ -120,6 +120,10 @@ class Core:
|
|||||||
self.send_message(self.message_text, chat_to_send)
|
self.send_message(self.message_text, chat_to_send)
|
||||||
|
|
||||||
def start_new_dialog(self, chat_ids):
|
def start_new_dialog(self, chat_ids):
|
||||||
|
for chat in chat_ids:
|
||||||
|
current_dialog = mongo.get_current_dialog(chat)
|
||||||
|
if current_dialog:
|
||||||
|
mongo.finish_dialog(current_dialog['_id'])
|
||||||
self.set_state('search', chat_ids)
|
self.set_state('search', chat_ids)
|
||||||
for chat in chat_ids:
|
for chat in chat_ids:
|
||||||
self.send_message("🤖 Начинаю искать собеседника. Сообщу тебе, когда найду его.", chat)
|
self.send_message("🤖 Начинаю искать собеседника. Сообщу тебе, когда найду его.", chat)
|
||||||
|
Loading…
Reference in New Issue
Block a user