Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.88 KB

README.md

File metadata and controls

44 lines (36 loc) · 1.88 KB

node-selfx-packager

A packaging script for node and demo repository

Prepare

  • Clone the repository
  • cd into mymodule directory and run: npm install
  • Test your module by running the script: ./workDir/run_module_directly.sh

Package

cd to the base of the repository and run the command below to package the application.

./selfXpackager.sh -s node-bin/launcher.sh -n selfExeSample -b node-bin/node -m mymodule/ -o dist/

Run

cd to workDir directory to apply overrides, or any directory where you would rather keep your overrides file and run the command below.

../dist/selfExeSample_launcher.sh

OR, if you had passed arch flag as x64, then:

../dist/selfExeSample_x64_launcher.sh

Note: it has name as: <process name>[_<arch flag>]_launcher.sh

Options

  • s: Path of the launcher script
  • n: Name of the final process when it starts.
  • b: Path to node.js binary
  • m: Path to nodejs module with dependencies
  • o: Output directory for the package.
  • t: Direct path to gzipped tar file, if you already have bundled it.
  • a: Processor/OS arch, Ex. x86/x64. Only used in file name, so you know which file is built with which node binary.

Directory structure

  • /mymodule: a sample node package. Check out the index.js file for sample code.
  • /node-bin: a directory place your node binary in. Does not have to be done so, but the command becomes easier that way.
  • /workDir: a directory to run the package from. There is a sample config overrides files in there.
  • /dist: This is where the output will be generated by the script.

Optionally loading js files

There was a requirement to allow a .js type file for configuration instead of .json. This can be achived by passing the full path to this .js as an attribute of application.json and requiring it from within application. Ex: {"config": "/.../application.config.js"}.