-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrenamed.py
38 lines (26 loc) · 814 Bytes
/
renamed.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
from fabric.api import *
import os
# Local path configuration (can be absolute or relative to fabfile)
env.deploy_path = 'output'
DEPLOY_PATH = env.deploy_path
env.repo = 'https://github.com/sloria/sloria.github.io.git'
def clean():
if os.path.isdir(DEPLOY_PATH):
local('rm -rf {deploy_path}'.format(**env))
local('mkdir {deploy_path}'.format(**env))
def build():
local('pelican -s pelicanconf.py')
def rebuild():
clean()
build()
def regenerate():
local('pelican -r -s pelicanconf.py')
def serve():
local('cd {deploy_path} && python -m SimpleHTTPServer'.format(**env))
def reserve():
build()
serve()
def publish():
local('pelican content -o output -s pelicanconf.py')
local('ghp-import output')
local('git push {repo} master'.format(**env))