post-commit git hook script not working as expected in JBoss BPM Suite 6 in Windows environment
Environment
- Red Hat JBoss BPM Suite (BPMS)
- 6.3
- 6.4
- Red Hat JBoss BRMS (BRMS)
- 6.3
- 6.4
Issue
- User is trying to update the remote
GIT repository
when they save the code/rules frombusiness-central
repository project as per the article mentioned here How to configure git hooks in B*MS 6.2 . The operating system used in this scenario isWindows 7
and the requirement is to push the commits automatically by using Git hooks. In the process it is observed that the post-commit hook is not running as expected but, when user runs the command manually then all the commits are posted to the repository properly. Is there any specific action that needs to be performed to achieve it inWindows
environment? - How to set post-commit git hook script for BPM Suite in Windows environment;
Resolution
- For
Windows
environment this issue can be fixed after installingGit client
andCygwin
(for windows) like softwares and ensure that the installation path (e.g./bin
directory) is properly set inWindows
environment'sPATH
variable (e.g.C:/cygwin/bin
). Also make sure to not add extensions to the post-commit script such as.bat
. - If the above does not work out even after having a
GIT client
andCygwin
already installed on theWindows
system the users can try out following options to test if it works.- Remove
Github
and otherGit clients
(if installed already) on theWindows
system. - Make sure to delete the
Git
folder manually if it is not deleted. - Also delete the contents of the
Github
folder in the O.S. user'sC:\Users\<USER_NAME>/AppData/Local
andC:\Users\<USER_NAME>/AppData/Roaming
directories. - Install
Git
freshly into the default location. - Add the following to the existing
PATH
system variable (the directory structure is given for demonstration only):
- Remove
C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\libexec\git-core;
Root Cause
In Windows OS git hooks requires Cygwin
installed to work properly.
Diagnostic Steps
- Check
java.library.path
inserver.log
to make sure thatCygwin
is onPATH
and JBoss EAP has identified it; - Check if
post-commit
script has any extension (such asbat
,exe
, etc). If so, rename the file topost-commit
only;
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments