Compare commits
3 Commits
master
...
8b9d1caed8
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b9d1caed8 | |||
| 8629f2f468 | |||
| bebda8fa5f |
@@ -21,7 +21,7 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- b-jokes-net
|
- b-jokes-net
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.dev.chocomarsh.com"
|
MONGO_HOST: "mongo.develop.sprinthub.ru"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
||||||
command: api
|
command: api
|
||||||
deploy:
|
deploy:
|
||||||
@@ -35,7 +35,7 @@ services:
|
|||||||
poll:
|
poll:
|
||||||
image: mathwave/sprint-repo:b-jokes
|
image: mathwave/sprint-repo:b-jokes
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.dev.chocomarsh.com"
|
MONGO_HOST: "mongo.develop.sprinthub.ru"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
||||||
command: poll
|
command: poll
|
||||||
deploy:
|
deploy:
|
||||||
@@ -49,9 +49,8 @@ services:
|
|||||||
bot:
|
bot:
|
||||||
image: mathwave/sprint-repo:b-jokes
|
image: mathwave/sprint-repo:b-jokes
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.dev.chocomarsh.com"
|
MONGO_HOST: "mongo.develop.sprinthub.ru"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
||||||
STAGE: "development"
|
|
||||||
command: bot
|
command: bot
|
||||||
networks:
|
networks:
|
||||||
- configurator
|
- configurator
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- b-jokes-net
|
- b-jokes-net
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.chocomarsh.com"
|
MONGO_HOST: "mongo.sprinthub.ru"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
||||||
DEBUG: "false"
|
DEBUG: "false"
|
||||||
command: api
|
command: api
|
||||||
@@ -36,7 +36,7 @@ services:
|
|||||||
poll:
|
poll:
|
||||||
image: mathwave/sprint-repo:b-jokes
|
image: mathwave/sprint-repo:b-jokes
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.chocomarsh.com"
|
MONGO_HOST: "mongo.sprinthub.ru"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
||||||
DEBUG: "false"
|
DEBUG: "false"
|
||||||
command: poll
|
command: poll
|
||||||
@@ -48,8 +48,29 @@ services:
|
|||||||
parallelism: 1
|
parallelism: 1
|
||||||
order: start-first
|
order: start-first
|
||||||
|
|
||||||
|
bot:
|
||||||
|
image: mathwave/sprint-repo:b-jokes
|
||||||
|
environment:
|
||||||
|
MONGO_HOST: "mongo.sprinthub.ru"
|
||||||
|
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
||||||
|
command: bot
|
||||||
|
networks:
|
||||||
|
- configurator
|
||||||
|
- queues
|
||||||
|
deploy:
|
||||||
|
mode: replicated
|
||||||
|
restart_policy:
|
||||||
|
condition: any
|
||||||
|
update_config:
|
||||||
|
parallelism: 1
|
||||||
|
order: start-first
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
b-jokes-net:
|
b-jokes-net:
|
||||||
driver: overlay
|
driver: overlay
|
||||||
common-infra-nginx:
|
common-infra-nginx:
|
||||||
external: true
|
external: true
|
||||||
|
configurator:
|
||||||
|
external: true
|
||||||
|
queues:
|
||||||
|
external: true
|
||||||
|
|||||||
@@ -12,7 +12,5 @@ if arg == "poll":
|
|||||||
jokes.poll_jokes()
|
jokes.poll_jokes()
|
||||||
elif arg == "api":
|
elif arg == "api":
|
||||||
main.run()
|
main.run()
|
||||||
elif arg == "bot":
|
|
||||||
main.bot()
|
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError("No arg specified!")
|
raise NotImplementedError("No arg specified!")
|
||||||
|
|||||||
1
main.py
1
main.py
@@ -55,7 +55,6 @@ def bot():
|
|||||||
text = payload.get('text')
|
text = payload.get('text')
|
||||||
if not text:
|
if not text:
|
||||||
return
|
return
|
||||||
text = text.lower()
|
|
||||||
for word in configurator.get_config('words'):
|
for word in configurator.get_config('words'):
|
||||||
if word in text:
|
if word in text:
|
||||||
mes = 'Держи шутку!\n' + get_random()
|
mes = 'Держи шутку!\n' + get_random()
|
||||||
|
|||||||
Reference in New Issue
Block a user