-
Notifications
You must be signed in to change notification settings - Fork 16
/
jenkins_build.cmd
66 lines (54 loc) · 1.72 KB
/
jenkins_build.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
@ECHO ON
set errorlevel=
set FILENAME=%TEMP%\%JOB_NAME%_%ENV%_%TAG%.zip
set LEGACY_FILENAME=%JOB_NAME%_%TAG%.zip
rmdir /s /q dist
rmdir /s /q x64
rmdir /s /q Release
pushd .
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvars64.bat" amd64
popd
MSBuild.exe /property:Configuration=Release /property:Platform=x64 /target:clean,build
if errorlevel 1 (
echo "Build Failed with %errorlevel%"
exit /b %errorlevel%
)
mkdir dist
if errorlevel 1 (
echo "mkdir dist failed with %errorlevel%"
exit /b %errorlevel%
)
xcopy x64\Release\*.dll dist\
if errorlevel 1 (
echo "Failed xcopy x64\Release\*.dll dist\ with %errorlevel%"
exit /b %errorlevel%
)
xcopy x64\Release\*.pdb dist\
if errorlevel 1 (
echo "Failed xcopy x64\Release\*.pdb dist\ with %errorlevel%"
exit /b %errorlevel%
)
xcopy third_party\obs-binaries\* dist\
if errorlevel 1 (
echo "Failed third_party\obs-binaries\* dist\ with %errorlevel%"
exit /b %errorlevel%
)
"C:\Program Files\7-Zip\7z.exe" a -r %FILENAME% -w .\dist\* -mem=AES256
@if errorlevel 1 (
echo "zip failed with %errorlevel%"
exit /b %errorlevel%
)
"C:\Program Files\Amazon\AWSCLI\aws.exe" s3api put-object --bucket bebo-app --key repo/%JOB_NAME%/%LEGACY_FILENAME% --body %FILENAME%
if "%LIVE%" == "true" (
"C:\Python34\python.exe" "C:\w\jenkins_uploader.py" --project %JOB_NAME% --tag %TAG% --env %ENV%
@if errorlevel 1 (
echo "jenkins_upload failed with %errorlevel%"
exit /b %errorlevel%
)
) else (
"C:\Python34\python.exe" "C:\w\jenkins_uploader.py" --project %JOB_NAME% --tag %TAG% --env %ENV% --no-deploy
@if errorlevel 1 (
echo "jenkins_upload failed with %errorlevel%"
exit /b %errorlevel%
)
)