update.sh bitbucket
Use the bitbucket subcommand with the update.sh script to update the values in the hook files in the Git repository.
Prerequisites
The update.sh bitbucket subcommand requires that you installed hook files by using configure.sh bitbucket. If the hook files are not present or were not installed through configure.sh bitbucket, then this subcommand terminates.
Execute the subcommand in the system where the Bitbucket server is started. Command arguments that accept a file or folder path should be valid paths inside this system.
Execute the subcommand as the operating system user who owns the bare Git repository directories
in the Bitbucket server. The user should have write permissions to the Git bare repository
directory.
Tip: You can run the ls -lcommand in the repositories
folder to find the operating user who owns the bare Git repository directories.
Tip: After you execute the subcommand, you can use the chown command to
change the ownership of the hook files to the system user who owns the bare Git
repositories
Usage
cd EWM Git Integration Toolkit/tools/install
./update.sh bitbucket -g git-repo-path [options]
Options
Option | Description | Required |
---|---|---|
-g/--gitlab-repo git-repo-path | Absolute path to the bare Git repository in the BitBucket 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 |
-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 |
-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
./update.sh bitbucket -h
# If the Git repositories managed by the BitBucket server are located under
/var/atlassian/application-data/bitbucket/shared/data/repositories
# Update hook files in a Git repository hosted in BitBucket server
cd EWM Git Integration Toolkit/tools/install
./update.sh bitbucket -t /opt/rtc-git-toolkit -g /var/atlassian/application-data/bitbucket/shared/data/repositories/myrepo.git
-l 4 -n /usr/bin/node
# Update hook files in a Git repository hosted in BitBucket server (long options)
cd EWM Git Integration Toolkit/tools/install
./update.sh bitbucket –git-toolkit /opt/rtc-git-toolkit --git-repo /var/atlassian/application-data/bitbucket/shared/data/repositories/myrepo.git
--trace-level 4 --node-exec /usr/bin/node