19.7. Customizing Git hook notifications
Business Central provides a mechanism that enables users to receive customized Git hook notifications based on the hook exit codes.
To enable the notification mechanism you must create a *.properties
file containing the custom messages and then specify the path to that file as the value of the appformer.git.hooks.bundle
system property.
Procedure
Create the
*.properties
file and add a line for each exit code with a corresponding message in the following format:<exit_code>=<display_message>
The
<exit_code>
is the Git hook exit code and the<display_message>
is the custom message that is displayed to a user.For example:
0=Success! All working as expected. 1=Warning! Please check the logs and advise your admin. . . 31=Error! Please advise your admin immediately.
0=Success! All working as expected. 1=Warning! Please check the logs and advise your admin. . . 31=Error! Please advise your admin immediately.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注記It is not necessary to define all the possible exit codes in the *.properties file. Notifications appear only for the exit codes defined in the *.properties file.
重要The notification service only supports the
ISO 8859-1
(LATIN 1
) character set in the properties file. If you want to use extended characters, please use their escaped Unicode character code sequences.To enable Git hook notifications, specify the path to the file as the value of the
appformer.git.hooks.bundle
system property.See the following example of a
standalone.xml
file with the setting that points to aMessages.properties
file:<system-properties> <property name="appformer.git.hooks.bundle" value="/opt/jboss-as/git-hooks-messages/Messages.properties"> </property> ... </system-properties>
<system-properties> <property name="appformer.git.hooks.bundle" value="/opt/jboss-as/git-hooks-messages/Messages.properties"> </property> ... </system-properties>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
19.7.1. Git hook notifications in Business Central リンクのコピーリンクがクリップボードにコピーされました!
You can view Git hook notifications in Business Central. There are three Git hook exit code notification types.
Exit code | Customized message | UI notification color |
---|---|---|
| Success! All working as expected. | Green |
| Warning! Please check the logs and advise your admin. | Orange |
| Error! Please advise your admin immediately. | Red |
UNIX machines only support error codes between 0 (success) to 255 (error), any exit code outside of this range will end up being converted into a different code which may cause showing a wrong notification message.
Windows machines don’t have this limitation and support a wide range of exit codes.