-
Notifications
You must be signed in to change notification settings - Fork 2
/
fabfile.py
30 lines (22 loc) · 923 Bytes
/
fabfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from fabric.api import *
import os
def descargar():
run ('sudo rm -rf IV')
run ('sudo git clone https://github.com/sergiocaceres/IV')
def detener():
run ("sudo supervisorctl stop comuni_bot")
def borrar():
run ('sudo rm -rf IV')
def instalar():
run ('cd IV && make install')
def recargar():
run("sudo supervisorctl reload")
def iniciar():
with shell_env(TOKENBOT=os.environ['TOKENBOT'], USR_BD=os.environ['USR_BD'], PASS_BD=os.environ['PASS_BD']):
run('sudo supervisorctl start comuni_bot')
def iniciar_no_supervisor():
with shell_env(TOKENBOT=os.environ['TOKENBOT'], USR_BD=os.environ['USR_BD'], PASS_BD=os.environ['PASS_BD']):
run('cd IV && make execute')
def iniciar_hup():
with shell_env(TOKENBOT=os.environ['TOKENBOT'], USR_BD=os.environ['USR_BD'], PASS_BD=os.environ['PASS_BD']):
run ('nohup python IV/bot_telegram/bot.py >& /dev/null &',pty=False)