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
e1c54f43
Unverified
Kaydet (Commit)
e1c54f43
authored
May 31, 2018
tarafından
Steve Dower
Kaydeden (comit)
GitHub
May 31, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Adds new upload script for Windows releases (GH-7268)
üst
0a36ac1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
0 deletions
+121
-0
uploadrelease.ps1
Tools/msi/uploadrelease.ps1
+121
-0
No files found.
Tools/msi/uploadrelease.ps1
0 → 100644
Dosyayı görüntüle @
e1c54f43
<#
.Synopsis
Uploads from a VSTS release build layout to python.org
.Description
Given the downloaded/extracted build artifact from a release
build run on python.visualstudio.com, this script uploads
the files to the correct locations.
.Parameter build
The location on disk of the extracted build artifact.
.Parameter user
The username to use when logging into the host.
.Parameter server
The host or PuTTY session name.
.Parameter target
The subdirectory on the host to copy files to.
.Parameter tests
The path to run download tests in.
.Parameter skipupload
Skip uploading
.Parameter skippurge
Skip purging the CDN
.Parameter skiptest
Skip the download tests
.Parameter skiphash
Skip displaying hashes
#>
param
(
[
Parameter
(
Mandatory
=
$true
)][
string
]
$build
,
[
Parameter
(
Mandatory
=
$true
)][
string
]
$user
,
[
string
]
$server
=
"python-downloads"
,
[
string
]
$target
=
"/srv/www.python.org/ftp/python"
,
[
string
]
$tests
=
${
env
:TEMP
}
,
[
switch
]
$skipupload
,
[
switch
]
$skippurge
,
[
switch
]
$skiptest
,
[
switch
]
$skiphash
)
if
(
-not
$build
)
{
throw
"-build option is required"
}
if
(
-not
$user
)
{
throw
"-user option is required"
}
function
find-putty-tool
{
param
([
string
]
$n
)
$t
=
gcm
$n
-EA 0
if
(
-not
$t
)
{
$t
=
gcm
".\
$n
"
-EA 0
}
if
(
-not
$t
)
{
$t
=
gcm
"
${
env
:ProgramFiles
}
\PuTTY\
$n
"
-EA 0
}
if
(
-not
$t
)
{
$t
=
gcm
"
${
env
:ProgramFiles
(x86)
}
\PuTTY\
$n
"
-EA 0
}
if
(
-not
$t
)
{
throw
"Unable to locate
$n
.exe. Please put it on
$PATH
"
}
return
gi
$t
.Path
}
$p
=
gci
-r
"
$build
\python-*.exe"
|
`
?
{
$_
.Name -match
'^python-(\d+\.\d+\.\d+)((a|b|rc)\d+)?-.+'
}
|
`
select
-first 1 |
`
%
{
$Matches
[
1],
$Matches
[
2]
}
"Uploading version
$(
$p
[
0]
)
$(
$p
[
1]
)
"
" from:
$build
"
" to:
$(
$server
)
:
$target
/
$(
$p
[
0]
)
"
" using:
$plink
and
$pscp
"
""
if
(
-not
$skipupload
)
{
# Upload files to the server
$pscp
=
find-putty-tool
"pscp"
$plink
=
find-putty-tool
"plink"
pushd
$build
$doc
=
gci
python
*
.chm, python
*
.chm.asc
popd
$d
=
"
$target
/
$(
$p
[
0]
)
/"
&
$plink
-batch
$user
@
$server
mkdir
$d
"&&"
chgrp
downloads
$d
"&&"
chmod
g-x,o+rx
$d
&
$pscp
-batch
$doc
.FullName
"
$user
@
${
server
}
:
$d
"
foreach
(
$a
in
gci
"
$build
"
-Directory
)
{
"Uploading files from
$(
$a
.FullName
)
"
pushd
"
$(
$a
.FullName
)
"
$exe
=
gci
*
.exe,
*
.exe.asc,
*
.zip,
*
.zip.asc
$msi
=
gci
*
.msi,
*
.msi.asc,
*
.msu,
*
.msu.asc
popd
&
$pscp
-batch
$exe
.FullName
"
$user
@
${
server
}
:
$d
"
$sd
=
"
$d
$(
$a
.Name
)$(
$p
[
1]
)
/"
&
$plink
-batch
$user
@
$server
mkdir
$sd
"&&"
chgrp
downloads
$sd
"&&"
chmod
g-x,o+rx
$sd
&
$pscp
-batch
$msi
.FullName
"
$user
@
${
server
}
:
$sd
"
&
$plink
-batch
$user
@
$server
chgrp
downloads
$sd
*
"&&"
chmod
g-x,o+rx
$sd
*
}
&
$plink
-batch
$user
@
$server
chgrp
downloads
$d
*
"&&"
chmod
g-x,o+rx
$d
*
}
if
(
-not
$skippurge
)
{
# Run a CDN purge
py purge.py
"
$(
$p
[
0]
)$(
$p
[
1]
)
"
}
if
(
-not
$skiptest
)
{
# Use each web installer to produce a layout. This will download
# each referenced file and validate their signatures/hashes.
gci
"
$build
\*-webinstall.exe"
-r -File | %
{
$d
=
mkdir
"
$tests
\
$(
$_
.BaseName
)
"
-Force
gci
$d
-r -File |
del
$ic
=
copy
$_
$d
-PassThru
"Checking layout for
$(
$ic
.Name
)
"
Start-Process
-wait
$ic
"/passive"
,
"/layout"
,
"
$d
\layout"
,
"/log"
,
"
$d
\log\install.log"
if
(
-not
$?
)
{
Write-Error
"Failed to validate layout of
$(
$inst
.Name
)
"
}
}
}
if
(
-not
$skiphash
)
{
# Display MD5 hash and size of each downloadable file
pushd
$build
gci
python
*
.chm,
*
\
*
.exe,
*
\
*
.zip |
`
Sort-Object
Name |
`
Format-Table
Name, @
{
Label
=
"MD5"
;
Expression
={(
Get-FileHash
$_
-Algorithm MD5
)
.Hash
}}
, Length
popd
}
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