Installing from source
======================

config.ymlで\ ``install_from_source``
を設定することにより、Gitリポジトリからビルドおよびインストールする拡張機能のリストを定義できます。

.. code:: yaml

   cluster_vars:
     install_from_source:
       - name: ext
         git_repository_url: https://repo.example.com/ext.git
         git_repository_ref: dev/example

       - name: otherext
         git_repository_url: ssh://repo.example.com/otherext.git
         git_repository_ref: master
         source_directory: /opt/postgres/src/otherext
         build_directory: /opt/postgres/build/otherext
         build_commands:
           - "make -f /opt/postgres/src/otherext/Makefile install"
         build_environment:
           VAR: value

TPAはリストされた順序で拡張機能を1つずつビルドしてインストールするため、正しい順序でメンションすることにより、別の拡張機能pglogicalやBDRなどに依存する拡張機能をビルドできます。

ビルドするには、各エントリーで\ ``name`` 、\ ``git_repository_url``
、および\ ``git_repository_ref`` デフォルト\ ``master``
を指定する必要があります。 :ref:`Git credentials <Git credentials>` を使用できます

Gitリポジトリに対して認証するため。また、上記のように\ ``source_directory``
、\ ``build_directory`` 、\ ``build_environment``
、および\ ``build_commands`` を設定します。

``tpaexec deploy … --skip-tags build-clean``
を実行して、展開を繰り返すときにビルドディレクトリを再利用します。それ以外の場合、古いビルドディレクトリはビルドを開始する前に空にされます。
:ref:`ローカルソースディレクトリ <ローカルソースディレクトリ>` を構成することもできます。

開発ビルドを高速化します。

ソースビルドを実行するたびに、Postgresが再起動されます。

ビルドの依存関係
----------------

ソースからビルドする場合、TPAは、基本的なPostgresビルドの依存関係がインストールされることを保証します。追加パッケージが必要な場合は、
:ref:`Installing packages <Installing packages>`  に記載してください。例

.. code:: yaml

   cluster_vars:
     packages:
       common:
       - golang-1.16
