-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfabfile.py
More file actions
94 lines (82 loc) · 2.34 KB
/
fabfile.py
File metadata and controls
94 lines (82 loc) · 2.34 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# -*- coding: utf-8 -*-
from fabric.api import *
import fabric.contrib.project as project
import os
# Local path configuration (can be absolute or relative to fabfile)
env.deploy_path = 'output'
#env.deploy_path = '.html'
env.static_path = '_static'
def build():
local('python code/planet.py config/du.ini && '
#'rsync -avzP4 {static_path}/media/ {deploy_path}/media/ && '
'pwd && '
'ls -la docs '
)
def _gh_pages():
local(#'cd {deploy_path} && '
'pwd && '
'git st && '
'git add --all . && '
'git ci -am "re-build from local => du.zoomquiet.io/planet/" && '
#'git pu cafe gitcafe-page '
'git pu && '
'date '.format(**env)
)
def pub():
build()
_gh_pages()
'''
env.py2sc = 'wiki/chaos2py4scientist/'
env.book = '_book/'
env.cafe_pages = '../../../7niu_zoomquiet/gitbook/'
#env.cafe_pages = '../../../42chaos2py4scientist/cafe_OpenMind/'
env.qrsync_bin = '/opt/bin/7niu_package_darwin_amd64/qrsync'
env.qrsync_cfg = '../7niu-zoomquiet.json'
def sync7niu():
local('pwd && '
'{qrsync_bin} {qrsync_cfg} && '
'date '.format(**env)
)
def pub7niu():
build()
book7niu()
sync7niu()
#cafe4wiki()
#cafe4gitbook()
def book7niu():
local('pwd && '
'cd {py2sc} && '
'gitbook build && '
'rsync -avzP4 {book} {cafe_pages} && '
#'ls -la && '
'date '.format(**env)
)
def wiki2cafe():
build()
local('cd {deploy_path} && '
'pwd && '
#'git pu && '
'git add --all . && '
#'git st && '
'git ci -am "re-build from local by markdoc @MBP111216ZQ" && '
#'git pu cafe gitcafe-page '
'git pu && '
'date '.format(**env)
)
def cafe4gitbook():
local('cd {py2sc} && '
'pwd && '
'gitbook build && '
#'pwd && '
#'cd {book} && '
'rsync -avzP4 {book} {cafe_pages} && '
#'ls -la && '
'cd {cafe_pages} && '
'git st && '
'git add --all . && '
'git ci -am "re-build from local by gitbook @MBP111216ZQ" && '
'git pu && '
#'ls -la && '
'date '.format(**env)
)
'''