Configuring the Git repository and hooks by using scripts
The IBM® Engineering Workflow Management (EWM) Git Integration Toolkit includes scripts to add EWM Git integration configuration variables, and install and configure hook files in Git repositories hosted in Node.js, GitLab, Gerrit, and Bitbucket servers.
The EWM Git Integration Toolkit includes two scripts, configure.sh and update.sh, which you use with subcommands that are specific to the Git hosting server.
Prerequisites
You must have the following programs installed and included in the PATH environment variable.
- bash
- getopt
- git
- sed
- node or node.js
You can use these scripts only on Git repositories that have not been configured.
Logging
Three of the scripts include a logging trace level parameter. Set the parameter to one of the following values.
Trace level | Description |
---|---|
0 | No logging. |
1 | Errors |
2 | Warnings |
3 | Informational |
4 | Verbose |
configure.sh
Use this script to add EWM Git Integration configuration variables and install the hook files in the bare Git repositories of Git hosting servers.
Execute the script in a bash shell. Navigate to the EWM Git Integration Toolkit/tools/install directory.
Usage
./configure.sh [sub command] [options]
Subcommand | Description |
---|---|
git | Adds the EWM Git configuration variables rtc.repokey and rtc.repourl in the Git repository’s config file. You must execute this subcommand for Git repositories hosted in Node.js, GitLab, and Gerrit servers, in addition to installing the hook files by using the other subcommands, to have a working EWM Git Integration. |
nodejs | Installs the hook files in a Git repository hosted in a Node.js server. |
gitlab | Installs the hook files in a Git repository hosted in a GitLab server. |
gerrit | Installs the hook files in a Gerrit server. |
Bitbucket | Installs the hook files in a Git repository hosted in a BitBucket server. |
update.sh
Use the update.sh script to update EWM configuration variables and update values inside hook files.
Execute the script in a bash shell. Navigate to the EWM Git Integration Toolkit/tools/install directory.
Usage
./update.sh [sub command] [options]
Subcommand | Description |
---|---|
git | Updates the EWM Git configuration variables rtc.repokey and rtc.repourl in the Git repository’s config file. The variables were previously configured through the configure.sh git command. |
nodejs | Updates the hook files in a Git repository hosted in a Node.js server. The hook files were previously installed through the configure.sh nodejs command. |
gitlab | Updates the hook files in a Git repository hosted in a GitLab server. The hook files were previously installed through the configure.sh gitlab command. |
gerrit | Updates the hook files in a Gerrit server. The hook files were previously installed through the configure.sh gerrit command. |
Bitbucket | Updates the hook files in a Git repository hosted in a BitBucket server. The hook files were previously installed through the configure.sh bitbucket command. |