-
Notifications
You must be signed in to change notification settings - Fork 4
/
fabfile.py
49 lines (36 loc) · 950 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
45
46
47
48
import os
from fabric.api import env, run, cd, local
env.hosts = ['[email protected]']
def deploy():
push()
pull()
build()
def party_ids():
with cd('~/site/'):
for f in os.listdir('_data'):
if f.endswith('_people.yaml'):
yield f[:-len("_people.yaml")]
def twitter_images(party=None):
with cd('~/site'):
if party is None:
for party_id in party_ids():
path = "_data/{}_people.yaml".format(party_id)
run('python _scripts/twitter_pics.py {}'.format(path))
else:
path = "_data/{}_people.yaml".format(party)
run('python _scripts/twitter_pics.py {}'.format(path))
def wikipedia_biogs(party=None):
pass
def push():
local('git push origin master')
def pull():
with cd('~/site/'):
run('git pull gh master')
def build():
with cd('~/site/'):
run('jekyll build')
def stop_api():
pass
def run_api():
with cd('~/site/_api'):
run('bash run')