Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
a4598a30
Kaydet (Commit)
a4598a30
authored
Mar 30, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
support CDN purging
üst
40e95dfc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
3 deletions
+48
-3
dailybuild.py
Doc/tools/dailybuild.py
+48
-3
No files found.
Doc/tools/dailybuild.py
Dosyayı görüntüle @
a4598a30
...
...
@@ -34,12 +34,29 @@ WWWROOT = '/data/ftp.python.org/pub/docs.python.org'
BRANCHES
=
[
# checkout, target, isdev
(
BUILDROOT
+
'/python3
3'
,
WWWROOT
+
'/3.3
'
,
False
),
(
BUILDROOT
+
'/python3
4'
,
WWWROOT
+
'/3.4
'
,
True
),
(
BUILDROOT
+
'/python3
4'
,
WWWROOT
+
'/3.4
'
,
False
),
(
BUILDROOT
+
'/python3
5'
,
WWWROOT
+
'/3.5
'
,
True
),
(
BUILDROOT
+
'/python27'
,
WWWROOT
+
'/2.7'
,
False
),
]
def
_files_changed
(
old
,
new
):
with
open
(
old
,
'rb'
)
as
fp1
,
open
(
new
,
'rb'
)
as
fp2
:
st1
=
os
.
fstat
(
fp1
.
fileno
())
st2
=
os
.
fstat
(
fp2
.
fileno
())
if
st1
.
st_size
!=
st2
.
st_size
:
return
False
if
st1
.
st_mtime
>=
st2
.
st_mtime
:
return
True
while
True
:
one
=
fp1
.
read
(
4096
)
two
=
fp2
.
read
(
4096
)
if
one
!=
two
:
return
False
if
one
==
''
:
break
return
True
def
build_one
(
checkout
,
target
,
isdev
,
quick
):
print
'Doc autobuild started in
%
s'
%
checkout
os
.
chdir
(
checkout
)
...
...
@@ -51,12 +68,40 @@ def build_one(checkout, target, isdev, quick):
if
os
.
WEXITSTATUS
(
os
.
system
(
'cd Doc; make SPHINXBUILD=
%
s
%
s'
%
(
SPHINXBUILD
,
maketarget
)))
==
2
:
print
'*'
*
80
return
print
(
'Computing changed files'
)
changed
=
[]
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
'Doc/build/html/'
):
dir_rel
=
dirpath
[
len
(
'Doc/build/html/'
):]
for
fn
in
filenames
:
local_path
=
os
.
path
.
join
(
dirpath
,
fn
)
rel_path
=
os
.
path
.
join
(
dir_rel
,
fn
)
target_path
=
os
.
path
.
join
(
target
,
rel_path
)
if
(
os
.
path
.
exists
(
target_path
)
and
not
_files_changed
(
target_path
,
local_path
)):
changed
.
append
(
rel_path
)
print
'Copying HTML files to
%
s'
%
target
os
.
system
(
'cp -a Doc/build/html/*
%
s'
%
target
)
if
not
quick
:
print
'Copying dist files'
os
.
system
(
'mkdir -p
%
s/archives'
%
target
)
os
.
system
(
'cp -a Doc/dist/*
%
s/archives'
%
target
)
changed
.
append
(
'archives/'
)
for
fn
in
os
.
listdir
(
os
.
path
.
join
(
target
,
'archives'
)):
changed
.
append
(
'archives/'
+
fn
)
print
'
%
s files changed'
%
len
(
changed
)
if
changed
:
target_ino
=
os
.
stat
(
target
)
.
st_ino
targets_dir
=
os
.
path
.
dirname
(
target
)
prefixes
=
[]
for
fn
in
os
.
listdir
(
targets_dir
):
if
os
.
stat
(
os
.
path
.
join
(
targets_dir
,
fn
))
.
st_ino
==
target_ino
:
prefixes
.
append
(
fn
)
to_purge
=
[]
for
prefix
in
prefixes
:
to_purge
.
extend
(
prefix
+
"/"
+
p
for
p
in
changed
)
purge_cmd
=
'curl -X PURGE "https://docs.python.org/{
%
s}"'
%
','
.
join
(
to_purge
)
print
(
"Running CDN purge"
)
os
.
system
(
purge_cmd
)
print
'Finished'
print
'='
*
80
...
...
@@ -84,7 +129,7 @@ if __name__ == '__main__':
if
args
:
if
len
(
args
)
!=
2
:
usage
()
build_one
(
args
[
0
],
args
[
1
]
,
devel
,
quick
)
build_one
(
os
.
path
.
abspath
(
args
[
0
]),
os
.
path
.
abspath
(
args
[
1
])
,
devel
,
quick
)
else
:
for
checkout
,
dest
,
devel
in
BRANCHES
:
build_one
(
checkout
,
dest
,
devel
,
quick
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment