38.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.3 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
/bin
folder is added to your environmentPATH
variable. 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
hooks
folder located in the repository Git folder of the project. For example:cd _EAP_HOME_/bin/.niogit/<SPACE>/<PROJECT_NAME>.git/hooks
$ cd _EAP_HOME_/bin/.niogit/<SPACE>/<PROJECT_NAME>.git/hooks
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
post-commit
file that pushes changes to the remote Git repository. For example:#!/bin/sh git push origin +master
#!/bin/sh git push origin +master
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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.
-
In Business Central go to Menu