[29230] | 1 | @echo off
|
---|
[29232] | 2 | setlocal
|
---|
[29230] | 3 |
|
---|
[30395] | 4 | :: http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-us
|
---|
[30405] | 5 | for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%b-%%a)
|
---|
[30395] | 6 | echo The current date is %mydate%
|
---|
| 7 |
|
---|
| 8 |
|
---|
[29232] | 9 | :: currentdir (C:\Research\Nightly)
|
---|
| 10 | set currentdir=%CD%
|
---|
| 11 |
|
---|
[29230] | 12 | :: Need to edit rke-setup.bat and fill it in with local env vars values
|
---|
[29232] | 13 | if not exist %currentdir%\tools\expeditee-release-kits\rke-setup.bat (
|
---|
[29230] | 14 | echo.
|
---|
| 15 | echo *******************
|
---|
| 16 | echo.
|
---|
[29232] | 17 | echo First edit %currentdir%\tools\expeditee-release-kits\rke-setup.bat.in
|
---|
| 18 | echo to generate %currentdir%\tools\expeditee-release-kits\rke-setup.bat
|
---|
[29230] | 19 | echo.
|
---|
| 20 | echo *******************
|
---|
| 21 | echo.
|
---|
| 22 | goto end
|
---|
| 23 | )
|
---|
| 24 |
|
---|
| 25 | :: rke-setup.bat uses local paths, so cd into expeditee-release-kits first
|
---|
| 26 | :: then call rke-setup.bat to source the environment vars it sets
|
---|
[29232] | 27 | pushd %currentdir%\tools\expeditee-release-kits
|
---|
[29230] | 28 | call rke-setup.bat
|
---|
[29232] | 29 | if ERRORLEVEL 1 (
|
---|
| 30 | echo error level 1 or more
|
---|
| 31 | popd
|
---|
| 32 | exit /B 1
|
---|
| 33 | )
|
---|
[29230] | 34 | popd
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | :: Make sure the expeditee folder and its rke-build.properties file exist
|
---|
| 38 | :: Then run the 'rke' command from snapshots\expeditee
|
---|
[29232] | 39 | pushd %currentdir%\snapshots
|
---|
[29230] | 40 | ::http://www.robvanderwoude.com/battech_ifexistfolder.php
|
---|
[30393] | 41 | if exist expeditee\ echo Deleting snapshots\expeditee&& rmdir /s /q expeditee
|
---|
[29230] | 42 | if not exist expeditee\ mkdir expeditee
|
---|
| 43 | if not exist expeditee\rke-build.properties copy C:\Research\Nightly\tools\expeditee-release-kits\rke-build.properties.in expeditee\rke-build.properties
|
---|
[29232] | 44 | pushd expeditee
|
---|
[29368] | 45 | call rke
|
---|
[29230] | 46 |
|
---|
[30395] | 47 | :: Uploading
|
---|
| 48 | mkdir uploads
|
---|
[30399] | 49 | copy products\Expeditee-1%products_suffix%.exe uploads\Expeditee-1-%mydate%%uploads_suffix%.exe
|
---|
[30406] | 50 | copy rke.out uploads\rke-%mydate%%os_suffix%-windows.out
|
---|
[30395] | 51 | set PATH=C:\Windows\System32\linuxtools;C:\Program Files (x86)\PuTTY2;%PATH%
|
---|
| 52 | :: Works from the cmd line:
|
---|
[30397] | 53 | :: cd uploads && tar.exe -c * | plink.exe -T -i "C:\Research\Nightly\tools\keys\upload-expeditee.ppk" [email protected]
|
---|
| 54 |
|
---|
[30395] | 55 | :: The following setcmd ends up partially running the cmd and uploading everything in snapshots\expeditee onto the remote machine
|
---|
[30397] | 56 | rem set upload_cmd=cd uploads && tar -c * | plink -T -i "C:\Research\Nightly\tools\keys\upload-expeditee.ppk" [email protected]
|
---|
[30395] | 57 | rem echo %upload_cmd%
|
---|
[30397] | 58 | cd uploads && tar -c * | plink -T -i "%identity_file%" [email protected]
|
---|
[30395] | 59 |
|
---|
[29230] | 60 | :end
|
---|
[29368] | 61 |
|
---|
| 62 | cd %currentdir%
|
---|
[29232] | 63 | endlocal
|
---|
[29368] | 64 | ::exit
|
---|