@@ -26,7 +26,8 @@ REM ****************************************************************************
26
26
27
27
REM
28
28
REM usage: MAKEPKG.BAT [< cmd> ]
29
- REM : Possible values for < cmd> are: CLEANUP and CREATEBINARY
29
+ REM : Possible values for < cmd> are: CLEANUP, CREATEBINARY
30
+ REM and CREATESTAGEBINARY
30
31
REM
31
32
REM expected to run this batch file from package sub-directory,
32
33
REM where a fresh clone is created.
@@ -38,6 +39,7 @@ if "%1" == "" GOTO usage
38
39
REM jump to appropriate sections based on < cmd>
39
40
if " %1 " == " CLEANUP" GOTO cleanup
40
41
if " %1 " == " CREATEBINARY" GOTO createbinary
42
+ if " %1 " == " CREATESTAGEBINARY" GOTO createstagebinary
41
43
goto usage
42
44
43
45
REM cleanup section, remove file(s) created by this batch file
@@ -47,6 +49,67 @@ del ..\package-lock.json
47
49
del SHASUMS256.txt oracledb-v*-node-*.gz
48
50
goto exit
49
51
52
+
53
+ REM compile, package to gz file
54
+ :createstagebinary
55
+ echo " createstagebinary section"
56
+
57
+ REM Append SHA to LICENSE.MD
58
+ git checkout ..\LICENSE.md
59
+ setlocal enabledelayedexpansion
60
+ REM compose a string with commands to execute one by one
61
+
62
+ REM start with empty string
63
+ set CONCAT_STR =
64
+ REM capture SHA
65
+ FOR /F " tokens=* USEBACKQ" %%F IN (`git --git-dir=..\.git rev-parse HEAD`) DO (
66
+ SET CONCAT_STR = %%F
67
+ )
68
+
69
+ set DATE_STR =
70
+ FOR /F " tokens=* USEBACKQ" %%F IN (`DATE /T`) DO ( SET DATE_STR = %%F )
71
+
72
+ REM append output of other commands
73
+ set CMD_STR = " git --git-dir=..\odpi\.git rev-parse HEAD && node --version"
74
+ for /f %%i in ('%CMD_STR% ') do set " CONCAT_STR = !CONCAT_STR! %%i "
75
+ set CONCAT_STR = !CONCAT_STR! !DATE_STR!
76
+ echo !CONCAT_STR! >> ..\LICENSE.MD
77
+
78
+ REM Compile node-oracledb
79
+ cd ..
80
+ CALL npm install
81
+ echo " NODE oracledb compiled"
82
+ cd package
83
+ echo " ==> Staging Binary package created for Node.js "
84
+
85
+ Set " hostname = %NODE_ORACLEDB_PACKAGE_HOSTNAME% "
86
+ Set " pathname = %NODE_ORACLEDB_PACKAGE_URL_PATH% "
87
+ Set " newname = %NODE_PKG_HOSTNAME% "
88
+ echo ON
89
+ echo %hostname%
90
+ echo %pathname%
91
+ echo %newname%
92
+
93
+ sed " s/github.com/%hostname% /g" oracledbinstall.js
94
+ sed " s/oracle\/node-oracledb\/releases\/download\//%pathname% /g" oracledbinstall.js
95
+
96
+ del /S *.gz
97
+
98
+ node createpackage.js
99
+ xcopy /Y " package.json" " ../package.json"
100
+ npm pack
101
+ Setlocal enabledelayedexpansion
102
+
103
+ Set " Pattern = oracledb"
104
+ Set " Replace = oracledb-staging"
105
+
106
+ For %%a in (*.gz) Do (
107
+ Set " File = %%~a "
108
+ Ren " %%a " " !File:%Pattern% =%Replace% ! "
109
+ )
110
+
111
+ goto exit
112
+
50
113
REM compile, package to gz file
51
114
:createbinary
52
115
echo " createbinary section"
0 commit comments