Kaydet (Commit) f2beceb7 authored tarafından Steve Dower's avatar Steve Dower Kaydeden (comit) GitHub

bpo-29624: Adds purge step and layout test after uploading files. (#258) (#264)

üst 2197eac6
...@@ -9,6 +9,8 @@ set USER= ...@@ -9,6 +9,8 @@ set USER=
set TARGET= set TARGET=
set DRYRUN=false set DRYRUN=false
set NOGPG= set NOGPG=
set PURGE_OPTION=/p:Purge=true
set NOTEST=
:CheckOpts :CheckOpts
if "%1" EQU "-h" goto Help if "%1" EQU "-h" goto Help
...@@ -19,7 +21,11 @@ if "%1" EQU "--user" (set USER=%~2) && shift && shift && goto CheckOpts ...@@ -19,7 +21,11 @@ if "%1" EQU "--user" (set USER=%~2) && shift && shift && goto CheckOpts
if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts
if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts
if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts
if "%1" EQU "--no-gpg" (set NOGPG=true) && shift && goto CheckOpts if "%1" EQU "--skip-gpg" (set NOGPG=true) && shift && goto CheckOpts
if "%1" EQU "--skip-purge" (set PURGE_OPTION=) && shift && godo CheckOpts
if "%1" EQU "--skip-test" (set NOTEST=true) && shift && godo CheckOpts
if "%1" EQU "-T" (set NOTEST=true) && shift && godo CheckOpts
if "%1" NEQ "" echo Unexpected argument "%1" & exit /B 1
if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc" if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
if not defined PLINK where /R "%ProgramFiles(x86)%\PuTTY" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc" if not defined PLINK where /R "%ProgramFiles(x86)%\PuTTY" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
...@@ -35,7 +41,7 @@ echo Found pscp.exe at %PSCP% ...@@ -35,7 +41,7 @@ echo Found pscp.exe at %PSCP%
if defined NOGPG ( if defined NOGPG (
set GPG= set GPG=
echo Skipping GPG signature generation because of --no-gpg echo Skipping GPG signature generation because of --skip-gpg
) else ( ) else (
if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc" if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
if not defined GPG where /R "%PCBUILD%..\externals\windows-installer" gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc" if not defined GPG where /R "%PCBUILD%..\externals\windows-installer" gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
...@@ -45,8 +51,12 @@ if defined NOGPG ( ...@@ -45,8 +51,12 @@ if defined NOGPG (
call "%PCBUILD%env.bat" > nul 2> nul call "%PCBUILD%env.bat" > nul 2> nul
pushd "%D%" pushd "%D%"
msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86 msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86 %PURGE_OPTION%
msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false %PURGE_OPTION%
if not defined NOTEST (
msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x86
msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x64
)
msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86 msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86
msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false
popd popd
...@@ -59,5 +69,8 @@ echo --host (-o) Specify the upload host (required) ...@@ -59,5 +69,8 @@ echo --host (-o) Specify the upload host (required)
echo --user (-u) Specify the user on the host (required) echo --user (-u) Specify the user on the host (required)
echo --target (-t) Specify the target directory on the host echo --target (-t) Specify the target directory on the host
echo --dry-run Display commands and filenames without executing them echo --dry-run Display commands and filenames without executing them
echo --skip-gpg Does not generate GPG signatures before uploading
echo --skip-purge Does not perform CDN purge after uploading
echo --skip-test (-T) Does not perform post-upload tests
echo -h Display this help information echo -h Display this help information
echo. echo.
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<DownloadUrlBase Condition="'$(DownloadUrlBase)' == ''">/srv/www.python.org/ftp/python</DownloadUrlBase> <DownloadUrlBase Condition="'$(DownloadUrlBase)' == ''">/srv/www.python.org/ftp/python</DownloadUrlBase>
<IncludeDoc Condition="'$(IncludeDoc)' == ''">true</IncludeDoc> <IncludeDoc Condition="'$(IncludeDoc)' == ''">true</IncludeDoc>
<DryRun Condition="'$(DryRun)' == ''">false</DryRun> <DryRun Condition="'$(DryRun)' == ''">false</DryRun>
<Purge Condition="'$(Purge)' == ''">false</Purge>
</PropertyGroup> </PropertyGroup>
<Import Project="msi.props" /> <Import Project="msi.props" />
...@@ -64,7 +65,36 @@ echo. ...@@ -64,7 +65,36 @@ echo.
echo." /> echo." />
</Target> </Target>
<Target Name="Upload" DependsOnTargets="_ValidateProperties;_RunGpg;_PrintNames;_Upload" /> <Target Name="_Purge" Condition="$(Purge) and !$(DryRun)">
<Error Condition="!Exists('$(PythonExe)')" Text="No Python executable available at $(PythonExe)" />
<Exec Command="&quot;$(PythonExe)&quot; purge.py $(PythonVersion)" />
</Target>
<Target Name="_TestLayout">
<ItemGroup>
<WebInstaller Include="$(OutputPath)\*-webinstall.exe" />
<WebInstaller>
<SourceDir>$(TEMP)\%(Filename)_source</SourceDir>
<SourceExe>$(TEMP)\%(Filename)_source\%(Filename)%(Extension)</SourceExe>
<LayoutDir>$(TEMP)\%(Filename)_layout</LayoutDir>
<LogDir>$(OutputPath)\%(Filename)_layoutlog</LogDir>
<LogFile>$(OutputPath)\%(Filename)_layoutlog\%(Filename).log</LogFile>
</WebInstaller>
</ItemGroup>
<RemoveDir Directories="%(WebInstaller.SourceDir)" Condition="Exists('%(WebInstaller.SourceDir)')" />
<RemoveDir Directories="%(WebInstaller.LayoutDir)" Condition="Exists('%(WebInstaller.LayoutDir)')" />
<RemoveDir Directories="%(WebInstaller.LogDir)" Condition="Exists('%(WebInstaller.LogDir)')" />
<MakeDir Directories="%(WebInstaller.SourceDir)" />
<Copy SourceFiles="@(WebInstaller)" DestinationFiles="%(WebInstaller.SourceExe)" />
<Exec Command="start &quot;Install test&quot; /wait &quot;%(WebInstaller.SourceExe)&quot; /layout &quot;%(WebInstaller.LayoutDir)&quot; /passive /log &quot;%(WebInstaller.LogFile)&quot;"
IgnoreExitCode="false" />
<RemoveDir Directories="%(WebInstaller.LayoutDir)" />
<RemoveDir Directories="%(WebInstaller.SourceDir)" />
<RemoveDir Directories="%(WebInstaller.LogDir)" />
</Target>
<Target Name="Upload" DependsOnTargets="_ValidateProperties;_RunGpg;_PrintNames;_Upload;_Purge" />
<Target Name="Test" DependsOnTargets="_TestLayout" />
<Target Name="ShowHashes"> <Target Name="ShowHashes">
<ItemGroup> <ItemGroup>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment