This repository has been archived by the owner on Dec 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild_node.bat
71 lines (55 loc) · 1.97 KB
/
build_node.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
@echo off
SETLOCAL
SET EL=0
echo ------ NODEJS -----
:: guard to make sure settings have been sourced
IF "%ROOTDIR%"=="" ( echo "ROOTDIR variable not set" && GOTO DONE )
IF "%S3_URL%"=="" ( echo "S3_URL variable not set" && GOTO DONE )
ECHO NODE_VERSION: %NODE_VERSION%
ECHO NAME: %NAME%
ECHO BRANCH: %BRANCH%
ECHO REPO: %REPO%
ECHO BUILDPLATFORM: %BUILDPLATFORM%
ECHO BUILD_TYPE: %BUILD_TYPE%
ECHO ROOTDIR: %ROOTDIR%
ECHO S3_URL: %S3_URL%
SET PUB=0
IF "%1"=="" ( ECHO using default %NODE_VERSION% ) ELSE ( SET NODE_VERSION=%1)
ECHO using %NODE_VERSION%
cd %PKGDIR%
if NOT EXIST node-v%NODE_VERSION%-%BUILDPLATFORM% (
git clone %REPO% -b %BRANCH% node-v%NODE_VERSION%-%BUILDPLATFORM%
IF ERRORLEVEL 1 GOTO ERROR
)
cd node-v%NODE_VERSION%-%BUILDPLATFORM%
IF ERRORLEVEL 1 GOTO ERROR
:: clear out previous builds
if EXIST %BUILD_TYPE% (
rd /q /s %BUILD_TYPE%
)
ECHO.
ECHO ---------------- BUILDING NODE %NODE_VERSION% --------------
CALL vcbuild.bat %BUILD_TYPE% %BUILDPLATFORM% nosign dll
IF ERRORLEVEL 1 GOTO ERROR
SET ARCHPATH=
IF %BUILDPLATFORM% EQU x64 (SET ARCHPATH=x64/)
call aws s3 cp --acl public-read %BUILD_TYPE%\node.exe %S3_URL%/v%NODE_VERSION%/%ARCHPATH%
::IF ERRORLEVEL 1 GOTO ERROR
call aws s3 cp --acl public-read %BUILD_TYPE%\node.lib %S3_URL%/v%NODE_VERSION%/%ARCHPATH%
::IF ERRORLEVEL 1 GOTO ERROR
call aws s3 cp --acl public-read %BUILD_TYPE%\node.exp %S3_URL%/v%NODE_VERSION%/%ARCHPATH%
::IF ERRORLEVEL 1 GOTO ERROR
call aws s3 cp --acl public-read %BUILD_TYPE%\node.pdb %S3_URL%/v%NODE_VERSION%/%ARCHPATH%
::IF ERRORLEVEL 1 GOTO ERROR
call aws s3 cp --acl public-read %BUILD_TYPE%\openssl-cli.exe %S3_URL%/v%NODE_VERSION%/%ARCHPATH%
::IF ERRORLEVEL 1 GOTO ERROR
call aws s3 cp --acl public-read %BUILD_TYPE%\openssl-cli.pdb %S3_URL%/v%NODE_VERSION%/%ARCHPATH%
::IF ERRORLEVEL 1 GOTO ERROR
GOTO DONE
:ERROR
SET EL=%ERRORLEVEL%
echo ----------ERROR NODE %NODE_VERSION% --------------
:DONE
echo ----------DONE NODE %NODE_VERSION% --------------
cd %ROOTDIR%
EXIT /b %EL%