-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
44 lines (37 loc) · 947 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from fabric.api import *
from fabric.contrib.project import rsync_project
from fabric.utils import puts
from fabric.operations import local
from fabric.contrib.files import sed
import os
import time
import socket
@task
def build():
local("npm run build")
@task
def prod():
env.port = 2221
env.hosts.append('[email protected]')
env.DEPLOY_TO = '/var/www/bellance/'
deploy_targets = [prod]
@task
def deploy():
require('DEPLOY_TO', provided_by=deploy_targets)
rsync_project(
local_dir=os.getcwd() + '/build/',
remote_dir=env.DEPLOY_TO + 'web/',
extra_opts='-l',
exclude=[],
delete=True
)
@task
def deploy_api():
require('DEPLOY_TO', provided_by=deploy_targets)
rsync_project(
local_dir=os.getcwd() + '/api/',
remote_dir=env.DEPLOY_TO + 'api/',
extra_opts='-l',
exclude=[],
delete=True
)