forked from gregglind/programmingwithsquirrels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfabfile.py
More file actions
27 lines (22 loc) · 660 Bytes
/
Copy pathfabfile.py
File metadata and controls
27 lines (22 loc) · 660 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
from fabric.api import env,lcd,cd,run,task,local
from contextlib import contextmanager
import os
def here():
return os.path.dirname(env['real_fabfile'])
@task
def build(force=False):
"cd book && rm -rf build/* && make html && cd -"
with lcd(here()) as s:
with lcd("book") as d:
if force:
local("rm -rf build/*")
local("make html")
@task
def rebuild():
""" "force" build, rm-ing first"""
build(force=True)
@task
def deploy():
"rsync -av book gregg@69.164.205.89:~/public_html"
with lcd(here()) as s:
local("rsync -av book gregg@69.164.205.89:~/public_html")