-
Notifications
You must be signed in to change notification settings - Fork 9
/
fabfile.py
111 lines (97 loc) · 2.85 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
from fabric.api import *
import fabric.contrib.project as project
import os
local_settings = os.path.expanduser(
os.path.join(os.path.dirname(__file__), 'local_settings.py'))
if os.path.exists(local_settings):
execfile(local_settings)
# Local path configuration (can be absolute or relative to fabfile)
#########################################
# deploy for 7niu CDN
#########################################
#env.input_path = 'docs'
env.deploy_path = 'out'
DEPLOY_PATH = env.deploy_path
def build():
local('python bin/app.py -g')
def pub2hub():
build()
local('cd {deploy_path} && '
'git status && '
'git add . && '
'git commit -am \'upgraded from local. by StaticPyCon\' && '
'git push'.format(**env)
)
#########################################
# deploy for gitcafe-pages
#########################################
'''
def pub2cafe():
build()
local('cd {deploy_path} && '
'git status && '
'git add . && '
'git commit -am \'upgraded from local. by StaticPyCon\' && '
'git push origin gitcafe-pages'.format(**env)
)
'''
# 141013 ZQ appended new actions for pub. through gitcafe-pages
'''depend on:
0. ACL for https://gitcafe.com/PyConChina/PyConChina
1. re-link staticpycon/out -> ../7niu.pyconcn/2014/
2. editor ../7niu.pyconcn/2014/.git/config appended like
...
env.qiniu = '/opt/bin/7niu_package_darwin_amd64/qrsync'
env.qiniu_conf = '../7niu-pycon.json'
env.qiniu_path = '../7niu.pyconcn'
def put7niu():
local('cd {qiniu_path} && '
'pwd && '
'python gen4idx.py ./ footer-7niu.html zoomquiet && '
'{qiniu} {qiniu_conf}&& '
'pwd '.format(**env)
)
[branch "gitcafe-pages"]
remote = cafe
merge = refs/heads/gitcafe-pages
...
confirmed all OK this flow:
- fixed some src/data/*.md
- python bin/app.py -g
- cd out
- git ci -am "commit log some"
- git pu
so the daily working just:
$ fab pub2cafe
'''
# Remote server configuration
# deploy for upstream pycon-statics hosts
#env.roledefs = {
# 'smirrors': ['obp:9022'
# , 'root@PyConSS1'
# , 'root@PyConSS3'
# ]
# }
#env.out_dir = '/opt/www/PyConChina/'
#
#@roles('smirrors')
#def sync2upstreams():
# with cd('{out_dir}'.format(**env)):
# run('uname -a')
# run('pwd')
# run("git status" )
# run("git pull" )
#########################################
# deploy for upstream pycon-statics hosts
#########################################
#env.roledefs = {
# 'smirror': ['gw2obp']
# }
#env.static_site = '/opt/www/staticpycon'
#@roles('smirror')
#def sync4upstream():
# local('ssh gw2obp uname -a ; '
# 'cat {static_site}/deploy.py ; '
# 'cd {static_site} ; '
# 'python {static_site}/deploy.py'.format(**env)
# )