-
Notifications
You must be signed in to change notification settings - Fork 23
/
create_and_build_environments.bat
135 lines (120 loc) · 4.16 KB
/
create_and_build_environments.bat
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
@echo off
SETLOCAL
if "%1" == "" (
echo Missing parameters. Usage:
echo.
echo create_environments.bat ^<environment base-name^>
echo.
echo Example: create_and_build_environments.bat 2.1
echo Creates the following environments:
echo 2.1-YYYYMMDD-x86-release-static-gitsha
echo 2.1-YYYYMMDD-x64-release-static-gitsha
echo 2.1-YYYYMMDD-x86-release-fastbuild-static-gitsha
echo 2.1-YYYYMMDD-x64-release-fastbuild-static-gitsha
echo 2.1-YYYYMMDD-x86-debug-static-gitsha
echo 2.1-YYYYMMDD-x64-debug-static-gitsha
exit /b 1
)
git rev-parse --short HEAD > current-sha.txt
set /p SHA=<current-sha.txt
del current-sha.txt
set YYYYMMDD=%date:~10,4%%date:~4,2%%date:~7,2%
set BASENAME=%1
REM TODO(XXX): Reduce code duplication for creating and building with a subroutine.
echo Creating environment %BASENAME%-%YYYYMMDD%-x86-release-static-%SHA%
call create_environment.bat %BASENAME%-%YYYYMMDD%-x86-release-static-%SHA% >create-%BASENAME%-%YYYYMMDD%-x86-release-static-%SHA%.log 2>&1
if ERRORLEVEL 1 (
echo Creating x86 Release environment failed.
ENDLOCAL
exit /b 1
)
echo Creating environment %BASENAME%-%YYYYMMDD%-x64-release-static-%SHA%
call create_environment.bat %BASENAME%-%YYYYMMDD%-x64-release-static-%SHA% >create-%BASENAME%-%YYYYMMDD%-x64-release-static-%SHA%.log 2>&1
if ERRORLEVEL 1 (
echo Creating x64 Release environment failed.
ENDLOCAL
exit /b 1
)
echo Creating environment %BASENAME%-%YYYYMMDD%-x86-release-fastbuild-static-%SHA%
call create_environment.bat %BASENAME%-%YYYYMMDD%-x86-release-fastbuild-static-%SHA% >create-%BASENAME%-%YYYYMMDD%-x86-release-fastbuild-static-%SHA%.log 2>&1
if ERRORLEVEL 1 (
echo Creating x86 ReleaseFastbuild environment failed.
ENDLOCAL
exit /b 1
)
echo Creating environment %BASENAME%-%YYYYMMDD%-x64-release-fastbuild-static-%SHA%
call create_environment.bat %BASENAME%-%YYYYMMDD%-x64-release-fastbuild-static-%SHA% >create-%BASENAME%-%YYYYMMDD%-x64-release-fastbuild-static-%SHA%.log 2>&1
if ERRORLEVEL 1 (
echo Creating x64 ReleaseFastbuild environment failed.
ENDLOCAL
exit /b 1
)
REM echo Creating environment %BASENAME%-%YYYYMMDD%-x86-debug-static-%SHA%
REM call create_environment.bat %BASENAME%-%YYYYMMDD%-x86-debug-static-%SHA% 2>&1 >create-%BASENAME%-%YYYYMMDD%-x86-debug-static-%SHA%.log
REM if ERRORLEVEL 1 (
REM echo Creating x86 Debug environment failed.
REM ENDLOCAL
REM exit /b 1
REM )
REM echo Creating environment %BASENAME%-%YYYYMMDD%-x64-debug-static-%SHA%
REM call create_environment.bat %BASENAME%-%YYYYMMDD%-x64-debug-static-%SHA% 2>&1 >create-%BASENAME%-%YYYYMMDD%-x64-debug-static-%SHA%.log
REM if ERRORLEVEL 1 (
REM echo Creating x64 Debug environment failed.
REM ENDLOCAL
REM exit /b 1
REM )
echo Building x86 Release
cd %BASENAME%-%YYYYMMDD%-x86-release-static-%SHA%
call build_environment.bat x86 Release >build_environment.log 2>&1
if ERRORLEVEL 1 (
echo Building x86 Release failed.
ENDLOCAL
exit /b 1
)
cd ..
echo Building x64 Release
cd %BASENAME%-%YYYYMMDD%-x64-release-static-%SHA%
call build_environment.bat x64 Release >build_environment.log 2>&1
if ERRORLEVEL 1 (
echo Building x64 Release failed.
ENDLOCAL
exit /b 1
)
cd ..
echo Building x86 ReleaseFastbuild
cd %BASENAME%-%YYYYMMDD%-x86-release-fastbuild-static-%SHA%
call build_environment.bat x86 ReleaseFastbuild >build_environment.log 2>&1
if ERRORLEVEL 1 (
echo Building x86 ReleaseFastbuild failed.
ENDLOCAL
exit /b 1
)
cd ..
echo Building x64 RelaseFastbuild
cd %BASENAME%-%YYYYMMDD%-x64-release-fastbuild-static-%SHA%
call build_environment.bat x64 ReleaseFastbuild >build_environment.log 2>&1
if ERRORLEVEL 1 (
echo Building x64 ReleaseFastbuild failed.
ENDLOCAL
exit /b 1
)
cd ..
REM echo Building x86 Debug
REM cd %BASENAME%-%YYYYMMDD%-x86-debug-static-%SHA%
REM call build_environment.bat x86 Debug >build_environment.log 2>&1
REM if ERRORLEVEL 1 (
REM echo Building x86 Debug failed.
REM ENDLOCAL
REM exit /b 1
REM )
REM cd ..
REM echo Building x64 Debug
REM cd %BASENAME%-%YYYYMMDD%-x64-debug-static-%SHA%
REM call build_environment.bat x64 Debug >build_environment.log 2>&1
REM if ERRORLEVEL 1 (
REM echo Building x64 Debug failed.
REM ENDLOCAL
REM exit /b 1
REM )
REM cd ..
ENDLOCAL