configure.sh nodejs
Use the nodejs subcommand with the configure.sh script to add install the hook files into the hooks folder of the Git repository.
About this subcommand
By default, the nodejs subcommand configures the pre-receive and post-receive scripts in the EWM Git Integration Toolkit/server/hooks/examples directory and copies them to the hooks directory of the Git repository hosted on the Node.js server. You can install the pre-receive hook or the post-receive hook by using the options --pre-receive and --post-receive.
Prerequisites
Execute the configure.sh git subcommand to add EWM Git configuration variables to the Git repository to have a working EWM Git Integration.
Execute the nodejs subcommand for each Git repository that you want to integrate with EWM.
Execute the subcommand in the system where the Node.js server is started. Command arguments that accept a file or folder path should be valid paths inside this system.
Usage
cd EWM Git Integration Toolkit/tools/install
./configure.sh nodejs -g git-repo-path [options]
Options
Option | Description | Required |
---|---|---|
-g/--git-repo git-repo-path | The absolute path to the bare Git repository on the Node.js server. | Yes |
-t/--rtc-git-toolkit path | Absolute path to EWM Git Integration Toolkit directory. By default, the parent directory containing this script is used as the toolkit directory. The toolkit directory path is updated in the pre-receive and post-receive hook files. You can provide a different EWM Git Integration Toolkit directory path, if required. | No |
-l/--trace-level trace-level | Trace level for the hook file and Node.js scripts. Valid values are 1, 2, 3, and 4. The values map to the following logging levels : 1-ERROR, 2-WARNING, 3-INFO, 4-DEBUG. | No |
-n/--node-exec path | Absolute path to the node executable. | No |
-a/--pre-receive | Configure only the pre-receive hook file. If you want to install both pre-receive and post-receive hooks, do not specify this option. | No |
-z/--post-receive | Configure only the post-receive hook file. If you want to install both pre-receive and post-receive hooks, do not provide this option. | No |
-h/--help | Displays this help message. | No |
Examples
# Display usage/help
cd EWM Git Integration Toolkit/tools/install
./configure.sh nodejs --help
# If the Git repositories managed by the Node.js server are located under /opt/git-data/repos/
# Configure hook files in a Git repository hosted in Node.js server
cd EWM Git Integration Toolkit/tools/install
./configure.sh nodejs -g /opt/git-data/repos/myrepo.git -l 4 -n /usr/bin/node
Configure hook files in a Git repository hosted in Node.js server (long options)
cd EWM Git Integration Toolkit/tools/install
./configure.sh nodejs --git-repo /opt/git-data/repos/myrepo.git --trace-level 4 --node-exec /usr/bin/node