-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
fabfile.py
49 lines (39 loc) · 1.19 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from fabric.api import task
from fabric.api import local
from fabric.api import lcd
from fabric.api import settings
@task
def make_html():
"""generate the web site"""
with settings(warn_only=True):
local('pelican content -o output -s pelicanconf.py -D')
@task
def re_make_html():
"""regenerate the web site"""
with settings(warn_only=True):
local('pelican -d output')
local('pelican content -o output -s pelicanconf.py -D')
@task
def auto_reload():
"""generate the web site(auto reload)"""
with settings(warn_only=True):
local('pelican content -o output -s pelicanconf.py -r -D')
@task
def push():
"""push to github"""
with settings(warn_only=True):
local('git add -A')
local('git commit -m "push"')
local('git push')
with lcd('output'):
local('git add -A')
local('git commit -m "push"')
local('git push')
@task
def server():
"""run http server at http://0.0.0.0:8000"""
with settings(warn_only=True):
with lcd('output'):
local('python -m SimpleHTTPServer')