-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfabfile.py
56 lines (45 loc) · 1.14 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
from fabric.api import run, env, cd, task, require
@task
def prod():
"""
Apply settings for prod
"""
env.name = 'prod'
env.hosts = ['jirabot@165.227.153.227']
env.user = 'jirabot'
env.project_path = '/home/jirabot/jira-telegram-bot'
env.venv_path = os.path.join(env.project_path, 'venv')
env.reload_file = os.path.join(env.project_path, 'bin', "reload_prod.sh")
@task
def stage():
"""
Apply settings for staging
"""
env.name = 'stage'
env.hosts = ['botelegram@46.28.194.157']
env.user = 'botelegram'
env.port = "22378"
env.project_path = '/home/botelegram/jira-telegram-bot'
env.venv_path = os.path.join(env.project_path, 'env')
env.reload_file = os.path.join(env.project_path, 'bin', "reload_stage.sh")
@task
def pull():
require('name')
with cd(env.project_path):
run('git pull')
@task
def reload_server():
"""
Execute a specific file to force server restart.
"""
require('name')
with cd(env.project_path):
run(env.reload_file)
@task
def deploy():
"""
Performs full stack deployment
"""
pull()
reload_server()