-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfabfile.py
38 lines (28 loc) · 1.17 KB
/
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
31
32
33
34
35
36
37
38
from fabric.api import *
import os
env.host = ['marco:22']
def start():
with shell_env(BOT_TOKEN=os.environ['BOT_TOKEN'], DB_PASSWORD=os.environ['DB_PASSWORD'], DB_USER=os.environ['DB_USER'], NODE_ENV=os.environ['NODE_ENV']):
run ('cd teletorrent && npm start')
def start_forever():
with shell_env(BOT_TOKEN=os.environ['BOT_TOKEN'], DB_PASSWORD=os.environ['DB_PASSWORD'], DB_USER=os.environ['DB_USER'], NODE_ENV=os.environ['NODE_ENV']):
run('sudo npm install -g forever')
run ('cd teletorrent && forever start index.js')
def stop_forever():
run('sudo forever stopall')
def clone():
run ('sudo rm -rf teletorrent')
run ('sudo git clone https://github.com/MarFerPra/teletorrent')
def remove():
run ('sudo rm -rf teletorrent')
def test():
run ('cd teletorrent && sudo npm test')
def install_dependencies():
run ('cd teletorrent && sudo npm install --silent')
def setup_node():
run ('sudo apt-get remove -y --purge nodejs')
run ('curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -')
run ('sudo apt-get install -y nodejs')
run ('sudo npm install npm@latest -g')
def ping():
run('echo Ping_received')