1 | @echo off
|
---|
2 | setlocal
|
---|
3 |
|
---|
4 | :: http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-us
|
---|
5 | for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%b-%%a)
|
---|
6 | echo The current date is %mydate%
|
---|
7 |
|
---|
8 |
|
---|
9 | :: currentdir (C:\Research\Nightly)
|
---|
10 | set currentdir=%CD%
|
---|
11 |
|
---|
12 | :: Need to edit rke-setup.bat and fill it in with local env vars values
|
---|
13 | if not exist %currentdir%\tools\expeditee-release-kits\rke-setup.bat (
|
---|
14 | echo.
|
---|
15 | echo *******************
|
---|
16 | echo.
|
---|
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
|
---|
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
|
---|
27 | pushd %currentdir%\tools\expeditee-release-kits
|
---|
28 | call rke-setup.bat
|
---|
29 | if ERRORLEVEL 1 (
|
---|
30 | echo error level 1 or more
|
---|
31 | popd
|
---|
32 | exit /B 1
|
---|
33 | )
|
---|
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
|
---|
39 | pushd %currentdir%\snapshots
|
---|
40 | ::http://www.robvanderwoude.com/battech_ifexistfolder.php
|
---|
41 | if exist expeditee\ echo Deleting snapshots\expeditee&& rmdir /s /q expeditee
|
---|
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
|
---|
44 | pushd expeditee
|
---|
45 | call rke
|
---|
46 |
|
---|
47 | :: Uploading
|
---|
48 | mkdir uploads
|
---|
49 | copy products\Expeditee-1%products_suffix%.exe uploads\Expeditee-1-%mydate%%uploads_suffix%.exe
|
---|
50 | copy rke.out uploads\rke-%mydate%%os_suffix%-windows.out
|
---|
51 | set PATH=C:\Windows\System32\linuxtools;C:\Program Files (x86)\PuTTY2;%PATH%
|
---|
52 | :: Works from the cmd line:
|
---|
53 | :: cd uploads && tar.exe -c * | plink.exe -T -i "C:\Research\Nightly\tools\keys\upload-expeditee.ppk" [email protected]
|
---|
54 |
|
---|
55 | :: The following setcmd ends up partially running the cmd and uploading everything in snapshots\expeditee onto the remote machine
|
---|
56 | rem set upload_cmd=cd uploads && tar -c * | plink -T -i "C:\Research\Nightly\tools\keys\upload-expeditee.ppk" [email protected]
|
---|
57 | rem echo %upload_cmd%
|
---|
58 | cd uploads && tar -c * | plink -T -i "%identity_file%" [email protected]
|
---|
59 |
|
---|
60 | :end
|
---|
61 |
|
---|
62 | cd %currentdir%
|
---|
63 | endlocal
|
---|
64 | ::exit
|
---|