forked from mozilla/marketplace-stats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
53 lines (39 loc) · 1.36 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
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))
MARKETPLACE_STATS = os.path.dirname(__file__)
ROOT = os.path.dirname(MARKETPLACE_STATS)
@task
def pre_update(ref):
with lcd(MARKETPLACE_STATS):
local('git fetch')
local('git fetch -t')
local('git reset --hard %s' % ref)
@task
def update():
with lcd(MARKETPLACE_STATS):
local('npm install')
local('npm install --force [email protected]')
local('commonplace includes')
local('commonplace langpacks')
@task
@roles('web')
@parallel
def _install_package(rpmbuild):
rpmbuild.install_package()
@task
def deploy():
with lcd(MARKETPLACE_STATS):
ref = local('git rev-parse HEAD', capture=True)
rpmbuild = helpers.deploy(name='marketplace-stats',
env=settings.ENV,
cluster=settings.CLUSTER,
domain=settings.DOMAIN,
root=ROOT,
deploy_roles=['web'],
package_dirs=['marketplace-stats'])