blob: 670836be8c1c8b30cb29210f761d0b8294b63e35 [file] [log] [blame]
Zachary Ware774ac372015-04-13 12:11:40 -05001@setlocal
2@echo off
3
4set D=%~dp0
5set PCBUILD=%D%..\..\PCBuild\
6
7set HOST=
8set USER=
9set TARGET=
10set DRYRUN=false
Steve Dowerd28a8a92015-10-23 09:50:49 -070011set NOGPG=
Steve Dowerf2beceb2017-02-23 15:03:20 -080012set PURGE_OPTION=/p:Purge=true
13set NOTEST=
Zachary Ware774ac372015-04-13 12:11:40 -050014
15:CheckOpts
16if "%1" EQU "-h" goto Help
17if "%1" EQU "-o" (set HOST=%~2) && shift && shift && goto CheckOpts
18if "%1" EQU "--host" (set HOST=%~2) && shift && shift && goto CheckOpts
19if "%1" EQU "-u" (set USER=%~2) && shift && shift && goto CheckOpts
20if "%1" EQU "--user" (set USER=%~2) && shift && shift && goto CheckOpts
21if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts
22if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts
23if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts
Steve Dowerf2beceb2017-02-23 15:03:20 -080024if "%1" EQU "--skip-gpg" (set NOGPG=true) && shift && goto CheckOpts
25if "%1" EQU "--skip-purge" (set PURGE_OPTION=) && shift && godo CheckOpts
26if "%1" EQU "--skip-test" (set NOTEST=true) && shift && godo CheckOpts
27if "%1" EQU "-T" (set NOTEST=true) && shift && godo CheckOpts
28if "%1" NEQ "" echo Unexpected argument "%1" & exit /B 1
Zachary Ware774ac372015-04-13 12:11:40 -050029
30if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
31if not defined PLINK where /R "%ProgramFiles(x86)%\PuTTY" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
32if not defined PLINK where /R "%ProgramFiles(x86)%" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
33if not defined PLINK echo Cannot locate plink.exe & exit /B 1
34echo Found plink.exe at %PLINK%
35
36if not defined PSCP where pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
37if not defined PSCP where /R "%ProgramFiles(x86)%\PuTTY" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
38if not defined PSCP where /R "%ProgramFiles(x86)%" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
39if not defined PSCP echo Cannot locate pscp.exe & exit /B 1
40echo Found pscp.exe at %PSCP%
41
Steve Dowerd28a8a92015-10-23 09:50:49 -070042if defined NOGPG (
43 set GPG=
Steve Dowerf2beceb2017-02-23 15:03:20 -080044 echo Skipping GPG signature generation because of --skip-gpg
Steve Dowerd28a8a92015-10-23 09:50:49 -070045) else (
46 if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
47 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"
48 if not defined GPG echo Cannot locate gpg2.exe. Signatures will not be uploaded & pause
49 echo Found gpg2.exe at %GPG%
50)
Zachary Ware774ac372015-04-13 12:11:40 -050051
52call "%PCBUILD%env.bat" > nul 2> nul
53pushd "%D%"
Steve Dowerf2beceb2017-02-23 15:03:20 -080054msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86 %PURGE_OPTION%
55msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false %PURGE_OPTION%
56if not defined NOTEST (
57 msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x86
58 msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x64
59)
Zachary Ware774ac372015-04-13 12:11:40 -050060msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86
61msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false
62popd
63exit /B 0
64
65:Help
66echo uploadrelease.bat --host HOST --user USERNAME [--target TARGET] [--dry-run] [-h]
67echo.
Steve Dowerf2beceb2017-02-23 15:03:20 -080068echo --host (-o) Specify the upload host (required)
69echo --user (-u) Specify the user on the host (required)
70echo --target (-t) Specify the target directory on the host
71echo --dry-run Display commands and filenames without executing them
72echo --skip-gpg Does not generate GPG signatures before uploading
73echo --skip-purge Does not perform CDN purge after uploading
74echo --skip-test (-T) Does not perform post-upload tests
75echo -h Display this help information
Zachary Ware774ac372015-04-13 12:11:40 -050076echo.