-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfabfile.py
More file actions
32 lines (19 loc) · 793 Bytes
/
fabfile.py
File metadata and controls
32 lines (19 loc) · 793 Bytes
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
import os
from fabric.api import local, lcd, hide
local_dir = os.path.dirname(os.path.realpath(__file__))
def test():
with hide('status', 'aborts'):
local('%s test --rednose --nologcapture' % os.path.join(local_dir, 'manage.py'))
def cov():
with hide('status', 'aborts'):
local('%s test --rednose --nologcapture --with-coverage --cover-package=stretch' % os.path.join(local_dir, 'manage.py'))
def build():
commit = _get_commit()
with lcd(local_dir):
_docker_build('stretch/master', commit)
with lcd(os.path.join(local_dir, 'agent')):
_docker_build('stretch/agent', commit)
def _docker_build(image, tag):
local('docker build -t %s:%s .' % (image, tag))
def _get_commit():
return local('git rev-parse HEAD', capture=True)