configure.sh gitlab
Use the gitlab subcommand with the configure.sh script to install the hook files in the Git repository hosted in a GitLab server.
About this subcommand
By default, the gitlab subcommand configures the pre-receive and post-receive scripts in the EWM Git Integration Toolkit/server/hooks/examples/gitlab directory and copies them to the custom_hooks directory of the Git repository hosted on the GitLab server.
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 gitlab subcommand for each Git repository that you want to integrate with EWM.
Execute the subcommand in the system where the GitLab server is running. 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 gitlab -g git-repo-path -r gitlab-url [options]
Options
Option | Description | Required |
---|---|---|
-g/--gitlab-repo git-repo-path | The absolute path to the bare Git repository on the GitLab server. | Yes |
-r/--gitlab-url url | URL of the GitLab server. | Yes |
-k/--gitlab-token token | Personal access token of a GitLab user. | 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 |
-u/--functional-user ID | User ID or email ID of a functional user in EWM. This is used in post-receive hooks only. | No |
-n/--node-exec path | Absolute path to the node executable. | No |
-s/-skip-verify-ssl value | Skip the verification of SSL server certificate of the GitLab server. Valid values are true and false. | 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 gitlab -h
# If the Git repositories managed by the GitLab server are located under /var/opt/gitlab/git-data/repositories
# Configure hook files in a Git repository hosted in GitLab
cd EWM Git Integration Toolkit/tools/install
./configure.sh gitlab -t /opt/rtc-git-toolkit -g /var/opt/gitlab/git-data/repositories/myrepo.git -r https://localhost
-k cd5d0cde8e8e11e9bc42526af7764f64 -l 2 -u ccm_user -n /usr/bin/node -s true
# Configure hook files in a Git repository hosted in GitLab (long options)
cd EWM Git Integration Toolkit/tools/install
./configure.sh gitlab --rtc-git-toolkit /opt/rtc-git-toolkit --gitlab-repo /var/opt/gitlab/git-data/repositories/myrepo.git
--gitlab-url https://localhost --gitlab-token cd5d0cde8e8e11e9bc42526af7764f64 --trace-level 2 --functional-user ccm_user
--node-exec /usr/bin/node --skip-verify-ssl true