-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy.cmd
executable file
·68 lines (54 loc) · 1.76 KB
/
deploy.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@ECHO OFF
:: setup my variables
set OLDDIR=%CD%
SET dir=d:\Archive\casperdeploy
SET cydir=d:/Archive/casperdeploy
SET [email protected]:kaveh096/CASPER.git
set PATH=%PATH%;D:\cygwin64\bin
:: clean enviroment
IF NOT EXIST %dir% ( git clone %url% %cydir% )
:: call build function
echo Going to build a nightly version
cd %dir%
call:buildFunc dev nightly
echo Going to build an stable version
cd %dir%
call:buildFunc master stable
goto :exit
:: ------------------------------------- build and post function
:buildFunc
:: switch to branch
git checkout %1
git pull
:: get hash of head
for /f %%i in ('git describe') do set revi=%%i
set "out=CASPER-%revi%-%2%.zip"
:: TODO create changle.log from 'git shortlog --no-merges %1 --not v10.1'
:: check if there is new commit to be built
for /f %%i in ('d:\cygwin64\bin\bash.exe -c "/home/kshahabi/dropbox_uploader.sh list | grep %out% | wc -l"') do set iscommit=%%i
if %iscommit%==1 (
echo No new code is commited to %1% branch
goto :eof
)
:: build clean
set NOREG=1
del /Q Package\EvcSolver32.*
del /Q Package\EvcSolver64.*
del /Q Package\README.md
msbuild.exe /m /target:rebuild /p:Configuration=Release /p:Platform=Win32 CASPER.sln
msbuild.exe /m /target:rebuild /p:Configuration=Release /p:Platform=x64 CASPER.sln
:: Generate readme file
"c:\Program Files (x86)\GnuWin32\bin\sed.exe" -e "s/REV/%revi%/g" README.md > Package\README.md
:: post to dropbox
cd Package
"c:\Program Files\7-Zip\7z.exe" a %out% [email protected]
if %errorlevel%==0 (
d:\cygwin64\bin\bash.exe -c '/home/kshahabi/dropbox_uploader.sh upload `cygpath -u "%CD%\%out%"` %out%'
) else (
echo Some of the files are not present
)
goto :eof
:: ------------------------------------- end of build function
:: restore current directory and then exit
:exit
chdir /d %OLDDIR%