@@ -64,7 +64,7 @@ def shell_out(cmd):
64
64
65
65
66
66
def build_one (version , isdev , quick , sphinxbuild , build_root , www_root ,
67
- skip_cache_invalidation = False ):
67
+ skip_cache_invalidation = False , group = 'docs' ):
68
68
checkout = build_root + "/python" + str (version ).replace ('.' , '' )
69
69
target = www_root + "/" + str (version )
70
70
logging .info ("Doc autobuild started in %s" , checkout )
@@ -92,16 +92,16 @@ def build_one(version, isdev, quick, sphinxbuild, build_root, www_root,
92
92
changed .append (rel_path )
93
93
94
94
logging .info ("Copying HTML files to %s" , target )
95
- shell_out ("chown -R :docs Doc/build/html/" )
95
+ shell_out ("chown -R :{} Doc/build/html/" . format ( group ) )
96
96
shell_out ("chmod -R o+r Doc/build/html/" )
97
97
shell_out ("find Doc/build/html/ -type d -exec chmod o+x {} ';'" )
98
98
shell_out ("cp -a Doc/build/html/* %s" % target )
99
99
if not quick :
100
100
logging .debug ("Copying dist files" )
101
- shell_out ("chown -R :docs Doc/dist/" )
101
+ shell_out ("chown -R :{} Doc/dist/" . format ( group ) )
102
102
shell_out ("chmod -R o+r Doc/dist/" )
103
103
shell_out ("mkdir -m o+rx -p %s/archives" % target )
104
- shell_out ("chown :docs %s /archives" % target )
104
+ shell_out ("chown :{} {} /archives" . format ( group , target ) )
105
105
shell_out ("cp -a Doc/dist/* %s/archives" % target )
106
106
changed .append ("archives/" )
107
107
for fn in os .listdir (os .path .join (target , "archives" )):
@@ -172,6 +172,10 @@ def parse_args():
172
172
"--skip-cache-invalidation" ,
173
173
help = "Skip fastly cache invalidation." ,
174
174
action = "store_true" )
175
+ parser .add_argument (
176
+ "--group" ,
177
+ help = "Group files on targets and www-root file should get." ,
178
+ default = "docs" )
175
179
return parser .parse_args ()
176
180
177
181
@@ -189,12 +193,13 @@ def parse_args():
189
193
if args .branch :
190
194
build_one (args .branch , args .devel , args .quick , sphinxbuild ,
191
195
args .build_root , args .www_root ,
192
- args .skip_cache_invalidation )
196
+ args .skip_cache_invalidation ,
197
+ args .group )
193
198
else :
194
199
for version , devel in BRANCHES :
195
200
build_one (version , devel , args .quick , sphinxbuild ,
196
201
args .build_root , args .www_root ,
197
- args .skip_cache_invalidation )
202
+ args .skip_cache_invalidation , args . group )
198
203
build_devguide (args .devguide_checkout , args .devguide_target ,
199
204
sphinxbuild , args .skip_cache_invalidation )
200
205
except Exception :
0 commit comments