forked from mozilla/rocketfuel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
50 lines (38 loc) · 1.26 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
import os
from fabric.api import env, execute, lcd, local, parallel, roles, task
from fabdeploytools import helpers
import fabdeploytools.envs
import deploysettings as settings
env.key_filename = settings.SSH_KEY
fabdeploytools.envs.loadenv(os.path.join('/etc/deploytools/envs',
settings.CLUSTER))
ROCKETFUEL = os.path.dirname(__file__)
ROOT = os.path.dirname(ROCKETFUEL)
@task
def pre_update(ref):
with lcd(ROCKETFUEL):
local('git fetch')
local('git fetch -t')
local('git reset --hard %s' % ref)
@task
def update():
with lcd(ROCKETFUEL):
local('npm install')
local('npm install -g commonplace')
local('commonplace includes')
@task
@roles('web')
@parallel
def _install_package(rpmbuild):
rpmbuild.install_package()
@task
def deploy():
with lcd(ROCKETFUEL):
ref = local('git rev-parse HEAD', capture=True)
rpmbuild = helpers.deploy(name='rocketfuel',
env=settings.ENV,
cluster=settings.CLUSTER,
domain=settings.DOMAIN,
root=ROOT,
deploy_roles=['web'],
package_dirs=['rocketfuel'])