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 repositorywhen they save the code/rules frombusiness-centralrepository 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 7and 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 inWindowsenvironment? - How to set post-commit git hook script for BPM Suite in Windows environment;
Resolution
- For
Windowsenvironment this issue can be fixed after installingGit clientandCygwin(for windows) like softwares and ensure that the installation path (e.g./bindirectory) is properly set inWindowsenvironment'sPATHvariable (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 clientandCygwinalready installed on theWindowssystem the users can try out following options to test if it works.- Remove
Githuband otherGit clients(if installed already) on theWindowssystem. - Make sure to delete the
Gitfolder manually if it is not deleted. - Also delete the contents of the
Githubfolder in the O.S. user'sC:\Users\<USER_NAME>/AppData/LocalandC:\Users\<USER_NAME>/AppData/Roamingdirectories. - Install
Gitfreshly into the default location. - Add the following to the existing
PATHsystem 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.pathinserver.logto make sure thatCygwinis onPATHand JBoss EAP has identified it; - Check if
post-commitscript has any extension (such asbat,exe, etc). If so, rename the file topost-commitonly;
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.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
