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 | :: installdir (C:\expeditee\expeditee-release-kits)
|
---|
10 | set installdir=C:\expeditee\expeditee-release-kits
|
---|
11 | cd %installdir%
|
---|
12 |
|
---|
13 | :: Need to edit rke-setup.bat and fill it in with local env vars values
|
---|
14 | if not exist %installdir%\rke-setup.bat (
|
---|
15 | echo.
|
---|
16 | echo *******************
|
---|
17 | echo.
|
---|
18 | echo First generate %installdir%\rke-setup.bat by copying
|
---|
19 | echo %installdir%\rke-setup.bat.in and editing it for your environment
|
---|
20 | echo.
|
---|
21 | echo *******************
|
---|
22 | echo.
|
---|
23 | goto end
|
---|
24 | )
|
---|
25 |
|
---|
26 | :: call rke-setup.bat to set the environment vars expeditee RK needs
|
---|
27 | call rke-setup.bat
|
---|
28 | if ERRORLEVEL 1 (
|
---|
29 | echo error level 1 or more
|
---|
30 | exit /B 1
|
---|
31 | )
|
---|
32 |
|
---|
33 |
|
---|
34 | :: Make sure the expeditee folder and its rke-build.properties file exist
|
---|
35 | :: Then run the 'rke' command from snapshots\expeditee
|
---|
36 | pushd %installdir%\snapshots
|
---|
37 | ::http://www.robvanderwoude.com/battech_ifexistfolder.php
|
---|
38 | if exist expeditee\ echo Deleting snapshots\expeditee&& rmdir /s /q expeditee
|
---|
39 | if not exist expeditee\ mkdir expeditee
|
---|
40 | if not exist expeditee\rke-build.properties copy %installdir%\rke-build.properties.in expeditee\rke-build.properties
|
---|
41 | pushd expeditee
|
---|
42 | echo About to call rke
|
---|
43 | call rke
|
---|
44 |
|
---|
45 |
|
---|
46 | echo rke done
|
---|
47 | echo Getting uploads ready
|
---|
48 | :: Uploading
|
---|
49 | mkdir uploads
|
---|
50 | copy products\Expeditee-1%products_suffix%.exe uploads\Expeditee-1-%mydate%%uploads_suffix%.exe
|
---|
51 | copy rke.out uploads\rke-%mydate%%os_suffix%-windows.out
|
---|
52 |
|
---|
53 | :: For now, we are uploading to www-internal. authorised_keys at that end will untar into /greenstone/files/expeditee
|
---|
54 | cd uploads && tar.exe -c * | plink -T -i "%identity_file%" [email protected]
|
---|
55 | :end
|
---|
56 |
|
---|
57 | cd %installdir%
|
---|
58 | endlocal
|
---|
59 | ::exit
|
---|