9c5905a20d | ||
---|---|---|
.. | ||
MAKEPKG.BAT | ||
Makefile | ||
README.md | ||
createpackage.js | ||
extractpackage.js | ||
getversion.js | ||
oracledbinstall.js | ||
package.json | ||
util.js |
README.md
Overview
This directory contains scripts for building, extracting and
installing binary packages of node-oracledb. Most users do not need
to use anything in this directory (the exceptions are when building
packages for self-hosting, or when doing a manual
install
instead of using npm
).
The binary install process requires two kinds of package:
-
a gzipped tar file like
oracledb-X.Y.Z.tgz
containing JavaScript and ancillary files suitable for npm to install. This is a generic file used on all platforms. -
a gzipped package like
oracledb-vZ.Y.Z-node-abi57-darwin-x64.gz
containing the binary add-on. The package uses a custom format with three components: length bytes (giving the length of the license file), the license file, and then the node-oracledb binary. Each Node.js version/architecture needs a unique binary package.A custom package format is used due to business and technical requirements:
-
the license text needs to be included with any binary download.
-
Node.js doesn't have a native archive module, and the installer should be lightweight and not have 3rd party dependencies.
-
When npm install oracledb
is executed, the JavaScript package is
first installed by npm. An 'install' script in its package.json
invokes oracledbinstall.js
. This downloads the appropriate
node-oracledb binary package, and then extracts and installs the
binary.
If a suitable binary package is not available, users must compile source code by installing from GitHub.
Installation is described in INSTALL.
Maintainers
-
The Makefile is used by node-oracledb maintainers to create the packages to be uploaded to GitHub and npm.
-
make npmpackage
makes the main node-oracledb package containing the general node-oracledb JavaScript files and the package.json in this directory. This is the package that annpm install oracledb
will initially install. -
make binarypackage
makes a binary package for the current Node.js / node-oracledb / platform combination and generates a SHA256 for the binary. A Windows batch file does the same for Windows.
-
-
As part of
npm install
, thepackage.json
in this directory invokesoracledbinstall.js
that downloads the appropriate binary package from GitHub. This variant ofpackage.json
is the copy bundled for the npm release.The parent file
../package.json
doesn't have the install target meaning that node-gyp will be invoked to compile node-oracledb. This allows installation from source code (via GitHub) when no suitable pre-built binary is available. -
The
make npmpackage
command creates three variants of the JavaScript bundle:-
oracledb-X.Y.Z.tgz
which downloads binaries from the node-oracledb GitHub release page. -
staging-oracledb-X.Y.Z.tgz
which downloads binaries from a server of your choice, specified by the environment variablesNODE_ORACLEDB_PACKAGE_HOSTNAME
(e.g. "your.example.com") andNODE_ORACLEDB_PACKAGE_URL_PATH
(e.g. "/yourpath/") which must be set before runningmake
. -
oracledb-src-X.Y.Z.tgz
which is the complete source code, mainly created because older npm's (e.g. with Node.js 4) do not download the opdi submodule code when installing from a GitHub tag or branch.
-
-
The
staging-oracledb-X.Y.Z.tgz
package can be used to host binaries on internal networks. Copystaging-oracledb-X.Y.Z.tgz
, the binary packages for each desired architectures, and a single SHASUMS256.txt file (with one line per available binary package) to an HTTPS-enabled web server to the directory that https://your.example.com/yourpath/vX.Y.Z/ resolves to. Note if the web server has a self-signed certificate, then you may need to bypass some npm checks:export NODE_TLS_REJECT_UNAUTHORIZED=0 npm config set strict-ssl false npm install https://your.example.com/yourpath/vX.Y.Z/staging-oracledb-X.Y.X.tgz
Remember to do
npm config delete strict-ssl
and unset the environment variable when not testing. -
On Windows, MAKEPKG.BAT has command options to create binaries, and also to create staged binaries and the main packages.
-
At install time, setting the environment variable
NODE_ORACLEDB_TRACE_INSTALL
toTRUE
will causenpm install
to display more tracing information. -
The installer scripts assume GitHub tags have the format "vX.Y.Z". Other assumptions about GitHub paths are also made in the scripts.
-
TODO
- oracledbinstall.js should cache SHASUMS256.txt so it doesn't have to be fetched twice.
- Add support for proxies that require authentication
- Improve oracledbinstall.js
no_proxy
support for domain names and wildcards.