統合の概要
統合は、Git ホスティングやSlackボットなどの外部サービスを使用したり、GitHub のコードリビュープルリクエスト機能の使用など、現在の開発プロセスを維持管理したりするのに役立ちます。 クラウドインフラストラクチャー上のAdobe Commerce プロジェクトに次の統合を追加できます。
Cloud CLI を使用して統合を追加するには:
次のコマンドを実行すると、新しい統合のタイプとオプションを選択するための対話型プロンプトが表示されます。
| code language-bash |
|---|
|
プロジェクトに設定されている統合をリストするには:
| code language-bash |
|---|
|
応答の例:
| code language-none |
|---|
|
Cloud Console を使用して統合を追加するには:
-
プロジェクト設定 で、「Integrations」をクリックします。
-
統合の種類をクリックするか、「Add integration」をクリックします。
-
統合タイプの選択と設定の手順について説明します。
-
統合を追加すると、統合ビューのリストに表示されます。
Commerce Webhook
ENABLE_WEBHOOK グローバル変数 を使用して、クラウドプロジェクト内でCommerce Webhook を設定できます。 Commerce Webhook は、Commerceが生成したイベントに応答して、外部サーバーにリクエストを送信します。 Webhook ガイド では、この機能について詳しく説明します。
汎用 Webhook
カスタム Webhook 統合を使用して、クラウドインフラストラクチャーとリポジトリのイベントを取得し、レポートして、JSON メッセージを Webhook URL に POST すことができます。
Webhook URL を追加するには、次の構文を使用します。
magento-cloud integration:add --type=webhook --url=https://hook-url.example.com
type-webhook統合タイプを指定します。url- JSON メッセージを受信できる Webhook URL を指定します。
応答のサンプルでは、統合をカスタマイズする機会を提供する一連のプロンプトを示しています。 デフォルト(空白)の応答を使用すると、プロジェクト内のすべての環境のすべてのイベントに関するメッセージが送信されます。
統合をカスタマイズして、分岐へのコードのプッシュなど、特定の イベント をレポートすることができます。 例えば、ユーザーがブランチにコードをプッシュする際にメッセージを送信するように、environment.push イベントを指定できます。
Events to report (--events)
A list of events to report, e.g. environment.push
Default: *
Enter comma-separated values (or leave this blank)
>
イベントの状態は、pending、in_progress、complete から選択できます。
States to report (--states)
A list of states to report, e.g. pending, in_progress, complete
Default: complete
Enter comma-separated values (or leave this blank)
>
また、特定の環境に対してメッセージを 含める または 除外 できます。
Included environments (--environments)
The environment IDs to include
Default: *
Enter comma-separated values (or leave this blank)
>
Excluded environments (--excluded-environments)
The environment IDs to exclude
Enter comma-separated values (or leave this blank)
>
統合が完了すると、値の概要が表示されます。
Created integration integration-ID (type: webhook)
+-----------------------+------------------------------+
| Property | Value |
+-----------------------+------------------------------+
| id | integration-ID |
| type | webhook |
| events | - '*' |
| environments | - '*' |
| excluded_environments | { } |
| states | - complete |
| url | https://hook-url.example.com |
+-----------------------+------------------------------+
既存の統合を更新
既存の統合は更新できます。 例えば、以下を使用して状態を complete から pending に変更します。
magento-cloud integration:update --states=pending <int-id>
応答の例:
Integration integration-ID (webhook) updated
+-----------------------+------------------------------+
| Property | Value |
+-----------------------+------------------------------+
| id | integration-ID |
| type | webhook |
| events | - '*' |
| environments | - '*' |
| excluded_environments | { } |
| states | - pending |
| url | https://hook-url.example.com |
+-----------------------+------------------------------+
報告するイベント
environment.access.addenvironment.access.removeenvironment.activateenvironment.backupenvironment.branchenvironment.deactivateenvironment.deleteenvironment.initializemaster ブランチが最初のコミットで初期化されましたenvironment.mergeenvironment.pushenvironment.restoreenvironment.route.createenvironment.route.deleteenvironment.route.updateenvironment.subscription.updatemaster 環境のサイズが変更されましたが、コンテンツの変更はありませんenvironment.synchronizeenvironment.update.http_accessenvironment.update.restrict_robotsenvironment.update.smtpenvironment.variable.createenvironment.variable.deleteenvironment.variable.updateproject.domain.createproject.domain.deleteproject.domain.update