set TARGET=\r
set DRYRUN=false\r
set NOGPG=\r
+set PURGE_OPTION=/p:Purge=true\r
+set NOTEST=\r
\r
:CheckOpts\r
if "%1" EQU "-h" goto Help\r
if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts\r
if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts\r
if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts\r
-if "%1" EQU "--no-gpg" (set NOGPG=true) && shift && goto CheckOpts\r
+if "%1" EQU "--skip-gpg" (set NOGPG=true) && shift && goto CheckOpts\r
+if "%1" EQU "--skip-purge" (set PURGE_OPTION=) && shift && godo CheckOpts\r
+if "%1" EQU "--skip-test" (set NOTEST=true) && shift && godo CheckOpts\r
+if "%1" EQU "-T" (set NOTEST=true) && shift && godo CheckOpts\r
+if "%1" NEQ "" echo Unexpected argument "%1" & exit /B 1\r
\r
if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"\r
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"\r
\r
if defined NOGPG (\r
set GPG=\r
- echo Skipping GPG signature generation because of --no-gpg\r
+ echo Skipping GPG signature generation because of --skip-gpg\r
) else (\r
if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"\r
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"\r
\r
call "%PCBUILD%env.bat" > nul 2> nul\r
pushd "%D%"\r
-msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86\r
-msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false\r
+msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86 %PURGE_OPTION%\r
+msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false %PURGE_OPTION%\r
+if not defined NOTEST (\r
+ msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x86\r
+ msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x64\r
+)\r
msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86\r
msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false\r
popd\r
:Help\r
echo uploadrelease.bat --host HOST --user USERNAME [--target TARGET] [--dry-run] [-h]\r
echo.\r
-echo --host (-o) Specify the upload host (required)\r
-echo --user (-u) Specify the user on the host (required)\r
-echo --target (-t) Specify the target directory on the host\r
-echo --dry-run Display commands and filenames without executing them\r
-echo -h Display this help information\r
+echo --host (-o) Specify the upload host (required)\r
+echo --user (-u) Specify the user on the host (required)\r
+echo --target (-t) Specify the target directory on the host\r
+echo --dry-run Display commands and filenames without executing them\r
+echo --skip-gpg Does not generate GPG signatures before uploading\r
+echo --skip-purge Does not perform CDN purge after uploading\r
+echo --skip-test (-T) Does not perform post-upload tests\r
+echo -h Display this help information\r
echo.\r
<DownloadUrlBase Condition="'$(DownloadUrlBase)' == ''">/srv/www.python.org/ftp/python</DownloadUrlBase>
<IncludeDoc Condition="'$(IncludeDoc)' == ''">true</IncludeDoc>
<DryRun Condition="'$(DryRun)' == ''">false</DryRun>
+ <Purge Condition="'$(Purge)' == ''">false</Purge>
</PropertyGroup>
<Import Project="msi.props" />
echo." />
</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=""$(PythonExe)" 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 "Install test" /wait "%(WebInstaller.SourceExe)" /layout "%(WebInstaller.LayoutDir)" /passive /log "%(WebInstaller.LogFile)""
+ 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">
<ItemGroup>