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 软件包

流程

  1. 在本地系统的目录中创建 post-commit Git hook。

    有关创建提交后 Git hook 的更多信息,请参阅 第 43.1 节 “创建提交后 Git hook”

  2. 要指定带有 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
  3. 启动 Business Central。

    post-commit Git hook 复制到所有 Business Central 内部存储库和项目存储库中。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.