統合の概要
統合機能は、Git ホスティングやSlack ボットなどの外部サービスの使用や、GitHubでのコードレビュープルリクエスト関数の使用などの現在の開発プロセスの維持に役立ちます。 Adobe Commerce on cloud インフラストラクチャプロジェクトには、次の統合機能を追加できます。
Cloud CLIを使用して統合を追加するには:
次のコマンドは、新しい統合のタイプとオプションを選択するためのインタラクティブなプロンプトを開始します。
| code language-bash |
|---|
|
プロジェクトに設定された統合を一覧表示するには:
| code language-bash |
|---|
|
回答サンプル:
| code language-none |
|---|
|
Cloud Consoleを使用して統合を追加するには:
-
プロジェクト設定で、Integrationsをクリックします。
-
統合タイプをクリックするか、Add integrationをクリックします。
-
統合タイプの選択と設定の手順を順を追って実行します。
-
統合を追加すると、統合ビューのリストに表示されます。
Commerce webhook
Cloud プロジェクトでCommerce Webhookを設定するには、ENABLE_WEBHOOKS グローバル変数を使用します。 Commerce webhookは、Commerceが生成したイベントに応じて、リクエストを外部サーバーに送信します。 Webhook ガイドでは、この機能について詳しく説明しています。
汎用webhook
カスタム Webhook統合を使用して、Cloud インフラストラクチャおよびリポジトリイベントをキャプチャし、レポートできます。POST JSON メッセージをWebhook URLに統合します。
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)
>
また、特定の環境に対して include または exclude のメッセージを実行できます。
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