-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.bat
65 lines (54 loc) · 2.02 KB
/
build.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
:: This script builds the server.
@ECHO OFF
SET build_dir=_build_
SET exe_dir=cmd
SET spa_server_dir=spaServer
SET settings_file=settings.txt
SET assets_folder=assets
SET tools_folder=tools
SET json_hasher_dir=jsonHasher
SET indexer_dir=indexer
SET spa_rp_server_dir=proxy
:: Create the folders.
MKDIR "%build_dir%"
MKDIR "%build_dir%\%spa_server_dir%"
MKDIR "%build_dir%\%tools_folder%"
MKDIR "%build_dir%\%tools_folder%\%json_hasher_dir%"
MKDIR "%build_dir%\%tools_folder%\%indexer_dir%"
MKDIR "%build_dir%\%spa_rp_server_dir%"
:: Build the SPA Server.
CD "%exe_dir%\%spa_server_dir%"
go build
IF %Errorlevel% NEQ 0 EXIT /b %Errorlevel%
MOVE "%spa_server_dir%.exe" ".\..\..\%build_dir%\%spa_server_dir%\"
CD ".\..\..\"
:: Copy some additional files for the server.
COPY "%exe_dir%\%spa_server_dir%\%settings_file%" "%build_dir%\%spa_server_dir%\"
:: Copy the assets.
COPY "%assets_folder%\favicon.ico.png" "%build_dir%\%spa_server_dir%\"
COPY "%assets_folder%\index.html" "%build_dir%\%spa_server_dir%\"
COPY "%assets_folder%\loader.js" "%build_dir%\%spa_server_dir%\"
COPY "%assets_folder%\styles.css" "%build_dir%\%spa_server_dir%\"
:: Build the CRC32 JSON Hasher.
CD "%exe_dir%\%json_hasher_dir%"
go build
IF %Errorlevel% NEQ 0 EXIT /b %Errorlevel%
MOVE "%json_hasher_dir%.exe" ".\..\..\%build_dir%\%tools_folder%\%json_hasher_dir%\"
CD ".\..\..\"
:: Build the Indexer.
CD "%exe_dir%\%indexer_dir%"
go build
IF %Errorlevel% NEQ 0 EXIT /b %Errorlevel%
MOVE "%indexer_dir%.exe" ".\..\..\%build_dir%\%tools_folder%\%indexer_dir%\"
CD ".\..\..\"
:: Copy some additional files for the indexer.
COPY "%exe_dir%\%indexer_dir%\%settings_file%" "%build_dir%\%tools_folder%\%indexer_dir%\"
:: Build the SPA Reverse Proxy Server.
CD "%exe_dir%\%spa_rp_server_dir%"
go build
IF %Errorlevel% NEQ 0 EXIT /b %Errorlevel%
MOVE "%spa_rp_server_dir%.exe" ".\..\..\%build_dir%\%spa_rp_server_dir%\"
CD ".\..\..\"
:: Copy some additional files for the server.
COPY "%exe_dir%\%spa_rp_server_dir%\%settings_file%" "%build_dir%\%spa_rp_server_dir%\"
ECHO SUCCESSFUL BUILD