43.4. 将 Git hook 配置为 Business Central 的系统属性
如果您没有现有的 Git 存储库项目,或者您要将 post-commit Git hook 应用到大量项目存储库,您可以指定一个包含 org.uberfire.nio.git.hooks
系统属性值的目录。此目录复制到 Git 存储库。
如果您指定了 org.uberfire.nio.git.hooks
系统属性,则所有 Business Central 内部存储库和项目存储库都使用 post-commit Git hook。您应该只在脚本中使用完全限定路径。
先决条件
- Red Hat Process Automation Manager 安装在 Red Hat JBoss EAP 7.3 服务器实例中。
-
(对于 Windows 操作系统)Cygwin 安装在安装过程中添加的 Git 软件包,Cygwin
/bin
文件夹添加到您的环境PATH
变量中。例如:C:\cygwin64\bin
。有关 Cygwin 安装的更多信息,请参阅 安装和更新 Cygwin 软件包。
流程
在本地系统的目录中创建 post-commit Git hook。
有关创建提交后 Git hook 的更多信息,请参阅 第 43.1 节 “创建提交后 Git hook”。
要指定带有
org.uberfire.nio.git.hooks
系统属性值的 hook 文件的目录,请执行以下操作之一:将
org.uberfire.nio.git.hooks
系统属性添加到standalone.xml
文件中。例如:<system-properties> <property name="org.uberfire.nio.git.hooks" value="_EAP_HOME_/hooks"> </property> ... </system-properties>
在执行 Business Central 时,请使用
-Dorg.uberfire.nio.git.hooks
环境变量。例如:$ ./standalone.sh -c standalone-full.xml -Dorg.uberfire.nio.git.hooks=_EAP_HOME_/hooks
启动 Business Central。
post-commit Git hook 复制到所有 Business Central 内部存储库和项目存储库中。
其他资源