-
Notifications
You must be signed in to change notification settings - Fork 2
Installation
The installation of the git-jira hook should be quite easy. The installation scripts have to be updated with key-value pairs of configuration settings and the changed files have to be made available for all developers of the team.
Below there is a short description of what the installation files does and which configuration properties have to be updated in order to make the git-jira hook work.
The requirements for running the hook is Java 8 Runtime Environment (JRE) and a bash terminal for installing the application.
There are several bash scripts which is used when installing or uninstalling the git-jira hook.
install.sh
pre-commit
commit-msg
uninstall.sh
This is used for installing the git-jira hook. It must be run for each developer of the team to be set up correctly.
The script is configuring the git config and copies the pre-commit and commit-msg hook to their correct location.
Update the GITHOOK_COMMON_PATH
to point to the location of the installation files shown above.
This script contains a routine for updating the git-jira hook if a newer version exists. At the moment there are two ways for doing this; Nexus Repository Manager for large projects or using a plain old directory which have to be maintained manually.
Update the property git_hook_new_filename
to the name of the jar file.
Example:
git_hook_new_filename=git-jira-hook-1.0.0.jar
In order to use Nexus Repository Manager, the following properties inside the pre-commit script have to be set:
-
NEXUS_ADDRESS
-
NEXUS_REPOSITORY_NAME
Also uncomment the lines regarding Nexus and comment the latter one.
Update the GITHOOK_COMMON_PATH
to point to the location of the installation files shown above.
Also comment the lines regarding Nexus Repository Manager.
This script executes the git-jira hook application when a developer commits code changes. There are no configuration settings.
This bash script is used for uninstalling the git-jira hook and remove the git configuration settings.
After preparing the installation files for a given git repository, you have to add the following to the .gitignore file.
debug.log
This file will be created by default when the git-jira hook is executed
For a given git repository which will be using the git-jira hook the following changes have to be done in order to make use of the hook.
- Create a directory which the installation files will be added, e.g
installation
. - Copy the files
install.sh
anduninstall.sh
to the directory. - Create a sub-directory which will contain the actual git hook files, e.g
git/hooks
- Copy the files
commit-msg
andpre-commit
to the sub-directory. - Commit and push the changes to the git repository.
Make sure that the directory names matches the properties in the installation files
These settings are set globally and is used for all git projects that are using the git-jira hook
[githook "jira"]
username = <username used by JIRA>
password = <password used by JIRA> <- This one is Base64 encoded.
address = <the address to the JIRA instance> e.g https://jira.yourcompany.com
These settings are set for each git project that's using the git-jira hook. The git-jira hook supports multiple JIRA projects which are configured by the projectkey
property below.
[githook]
language = en <- language code
[githook "jira"]
projectkey = <JIRA project name>, e.g EXAMPLE
projectkey = <JIRA project name>
...
For each project that uses the git-jira hook the standard location is shown below.
--- (root of git project)
|--- .git
| |--- hooks
| | |- pre-commit
| | |- commit-msg
| | |--- util
| | | |- githook.jar
|
|--- installation
| |---git
| | |--- hooks
| | | |- commit-msg
| | | |- pre-commit
| |- install.sh
| |- uninstall.sh
The file structure below installation
directory are used when installing the git-jira hook. The files under the .git
directory are used when executing git commands.