Integrations overview
Integrations are useful for using external services—such as Git hosting or Slack bots—and maintaining your current development processes, such as using the code review pull request function in GitHub. You can add the following integrations to your Adobe Commerce on cloud infrastructure project:
To add an integration using the Cloud CLI:
The following command begins interactive prompts to select the type and options for the new integration.
code language-bash |
---|
|
To list the integrations configured for your project:
code language-bash |
---|
|
Sample response:
code language-none |
---|
|
To add an integration using the Cloud Console:
-
In Project Settings, click Integrations.
-
Click on an integration type or click Add integration.
-
Step through the integration type selection and configuration steps.
-
After adding the integration, it appears in the list on the Integrations view.
Commerce webhooks
You can configure Commerce webhooks in your Cloud project with the ENABLE_WEBHOOKS global variable. Commerce webhooks send requests to an external server in response to Commerce-generated events. The Webhooks Guide describes this feature in detail.
Generic webhooks
You can capture and report Cloud infrastructure and repository events using a custom webhook integration to POST
JSON messages to a webhook URL.
To add a webhook URL, use the following syntax:
magento-cloud integration:add --type=webhook --url=https://hook-url.example.com
type
—Specify thewebhook
integration type.url
—Provide the webhook URL that can receive JSON messages.
The sample response shows a series of prompts that provide an opportunity to customize the integration. Using the default (blank) response sends messages about all events on all environments in a project.
You can customize the integration to report specific events, such as pushing code to a branch. For example, you can specify the environment.push
event to send a message when a user pushes code to a branch:
Events to report (--events)
A list of events to report, e.g. environment.push
Default: *
Enter comma-separated values (or leave this blank)
>
You can choose to report events in a pending
, in_progress
, or complete
state:
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)
>
And you can include or exclude messages for specific environments:
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)
>
When the integration is complete, you receive a summary of the values:
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 |
+-----------------------+------------------------------+
Update existing integration
You can update an existing integration. For example, change the states from complete
to pending
using the following:
magento-cloud integration:update --states=pending <int-id>
Sample response:
Integration integration-ID (webhook) updated
+-----------------------+------------------------------+
| Property | Value |
+-----------------------+------------------------------+
| id | integration-ID |
| type | webhook |
| events | - '*' |
| environments | - '*' |
| excluded_environments | { } |
| states | - pending |
| url | https://hook-url.example.com |
+-----------------------+------------------------------+
Events to report
environment.access.add
environment.access.remove
environment.activate
environment.backup
environment.branch
environment.deactivate
environment.delete
environment.initialize
master
branch of the project initialized with a first commitenvironment.merge
environment.push
environment.restore
environment.route.create
environment.route.delete
environment.route.update
environment.subscription.update
master
environment has been resized because the subscription has changed, but here are no content changesenvironment.synchronize
environment.update.http_access
environment.update.restrict_robots
environment.update.smtp
environment.variable.create
environment.variable.delete
environment.variable.update
project.domain.create
project.domain.delete
project.domain.update