19.3. Configuring Git hooks for existing remote Git project repositories
If you have an existing remote Git repository project you can create a post-commit Git hook in a remote Git repository of that existing project and integrate the remote Git repository with Business Central.
Prerequisites
- Red Hat Decision Manager is installed in a Red Hat JBoss EAP 7.2 server instance.
- Red Hat Decision Manager projects exist in an external Git repository.
- Read access credentials for the external Git repository.
-
(For Windows operating system) Cygwin is installed with the Git package added during installation and the path to the Cygwin
/binfolder is added to your environmentPATHvariable. For example,C:\cygwin64\bin. For more information about Cygwin installation, see Installing and Updating Cygwin Packages.
Procedure
In a command terminal, navigate to the
hooksfolder located in the repository Git folder of the project. For example:$ cd _EAP_HOME_/bin/.niogit/<SPACE>/<PROJECT_NAME>.git/hooks
Create a
post-commitfile that pushes changes to the remote Git repository. For example:#!/bin/sh git push origin +master
For more information about creating post-commit Git hooks, see 「Creating post-commit Git hooks」.
Optional: To check that the configuration was successful, create a guided rule in Business Central:
- In Business Central go to Menu → Projects → Add Asset → Guided Rule.
- On the Create new Guided Rule page, enter the required information.
Click Ok.
Business Central automatically pushes all changes to the remote repository.