0

I have not been successful at configuring jBPM (or KJAR) projects so that when I save any of my work (a git commit has occurred), jBPM's Guvnor Git should theoretically execute my script in the post-commit file in the /hooks directory.

The following is a simple working post-commit file's content. All it does is to push the committed changes automatically to my remote Git repo. The echo line is merely a sanity check.

#!C:\Program Files\Git\usr\bin\sh.exe
echo Executing post-commit! YAY!!
git push origin master

In case anybody's wondering why it is not the usual #!/bin/sh on the first line, this is the correct path to a sh.exe file in my Windows environment. It is a working configuration in all of my other projects.

My jBPM projects are imported into RHPAM/Business Central through GitHub via https://, using my username and password. I can verify that after it's imported, an origin remote URL has been set.

>> git remote -v
origin  https://github.com/myusername/my-kjar-project.git (fetch)
origin  https://github.com/myusername/my-kjar-project.git (push)

For the life of me, I am still scratching my head as to why this configuration is not working in any of my KJAR projects imported through jBPM after placing the post-commit file in the /hooks folder. I can invoke git push origin master without problem from the folder location of my jBPM project if I execute it on any CLI.

I followed the Repository hook configuration instructions for RHPAM 7.2, which is applicable for RHPAM 7.x as well as Business central >7.15. If anybody can offer any pointers, I will greatly appreciate the help.

For reference, this is my development environment setup:

  • Windows 10
  • Git SCM for Windows installed in C:\Program Files\Git
  • RHPAM 7.2 on EAP 7.2
  • Business Central 7.21 on WildFly 14
  • GitHub remote repo, using https:// instead of ssh://

For other references, this was a reported bug that was supposedly fixed in later versions of RHPAM and Business Central.

0

Okay, so I figured out the solution to this issue. It is indeed how RHPAM or Business Central behaves in a Windows environment. After reviewing a similar document for RHPAM 7.3 on repository hooks, apparently I need to use the shell provided by Cygwin instead of the shell provided by Git SCM.

Soo.... after installing Cygwin to C:\cygwin64, I simply have to change the post-commit file to include the following as the first line:

#!C:\cygwin64\bin\sh.exe

And don't forget to modify PATH to include Cygwin's \bin folder, so that sh.exe can be executed. That pretty much did the trick.

Side note: I am using RHPAM 7.2 instead of RHPAM 7.3 because of a critical bug that locks the jBPM project, preventing the project from being read properly. The fix is expected to come out in RHPAM 7.4. Having said that, I did not realize that instructions on repository hooks have been updated in RHPAM 7.3's documentation, which would have been helpful if it was included in RHPAM version 7.2 or earlier's documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.