Every Adobe Commerce on cloud infrastructure environment has an associated Git branch. You can manage your environments using either the Project Web Interface and the magento-cloud
CLI. You can use Git commands, but the cloud CLI commands interact with platform features whereas the Git commands do not. See Git commands in the cloud CLI topic.
This topic discusses how to use the Project Web Interface to:
master
branch for Pro plan Staging and Production. You can branch from a master
branch.git pull
) from the parent environmentgit push
) to the parent environmentYou cannot create branches from Pro Staging and Production environments.
The branching strategy uses a common Git workflow where you develop code and add extension in a development branch. See Starter and Pro architecture overviews.
staging
branch from the master
branch, then branch from staging
for development.Your account supports a limited number of active Git branches and an unlimited number of inactive development branches. Manage active and inactive branches by adding or deleting a branch. When deleted, a branch is deactivated and remains listed in the project branches list as inactive. You can activate the inactive branch later or you can delete the branch using the CLI.
If you need additional environments for development, enter a Support ticket.
To add a branch:
Log in to the Project Web Interface.
Click on the project.
In the left environment list, click the name of the parent environment.
Your new branch is cloned from this environment. Choose a parent environment that is similar to the environment that you are about to create.
Click (branch).
In the New environment name field, enter a branch name. Often, the environment name is the same as the ID.
The environment name is different from the environment ID only if you use spaces or capital letters in the environment name. An environment ID consists of all lowercase letters, numbers, and allowed symbols. Capital letters in an environment name are converted to lowercase in the ID; spaces in an environment name are converted to dashes.
An environment name cannot include characters reserved for your Linux shell or for regular expressions. Forbidden characters include curly braces ({ }
), parentheses, asterisk (*
), angle brackets (>
), ampersand (&
), percent (%
), and other characters.
Click Branch.
Wait while the environment deploys.
During deployment, the environment status is In process. After a successful deployment, the status changes to Success.
To delete an environment and make it inactive:
Log in to the Project Web Interface.
Click on the project.
In the left environment list, click the name of the branch to delete.
Click Configure environment.
Click the Settings tab.
Click Delete next to the environment status, as the following figure shows.
A deleted (inactive) environment displays with its name stricken out as the following figure shows.
Syncing an environment (or branch) is the same as git pull origin <parent>
. You sync to get updated code from a parent environment. You can use this feature through the interface for all Starter and Pro environments.
For Pro plan, you can also sync from Staging and Production to your Integration master
branch. This sync only pulls and pushes code, not data. To sync data, dump the database data and push it to another environment’s database. See Migrate and deploy static files and data.
To sync an environment:
Log in to the Project Web Interface.
Click on the project.
In the left environment list, click the name of the branch to sync.
Click (sync).
Select the items to sync.
code
—syncs updated code from the parent branch.data & files
— syncs changes in the database and content files from the parent branch.Click Sync.
Merging an environment (or branch) is the same as git push origin
. You merge to push updated code from an environment to its parent environment. You can merge this code to master
. You can deploy to Staging and Production using the merge
command.
To merge with parent environment:
Log in to the Project Web Interface.
Click on the project.
In the left environment list, click the name of the branch to merge.
Click (merge).
Click Merge to confirm the action.
Through the Project Web Interface, you can review various logs for environments including build, deploy, and deployment history.
For Starter, you can review build and deploy logs and the deployment history. These environments include the master
(Production) branch and all branches created from it.
For Pro, you can review the following logs in each environment:
To view logs in the Project Web Interface:
Log in to the Project Web Interface.
Click on the project.
In the left environment list, click the name of the branch to view logs.
The view provides a deployment history of one entry per action attempted including syncs, merges, branches, snapshots, and more.
To view the build log, select the Success or Failure link per deployment record on the account.
Click the Showing all types of messages drop-down list to change the type of messages to view.
Your Adobe Commerce on cloud infrastructure project can include code from a private Git repository. For example, you may have code for a custom module or theme in a private repo. To do so, you must add your project’s public SSH key to your private Git repository and update your project composer.json
file.
To add a deployment key to your private GitHub repository, you must be the administrator of that repository. GitHub allows you to use a deploy key for one repository only.
If your project needs to access multiple repositories, you can choose to attach an SSH key to an automated user account. Because this account is not used by a human, it is referred to as a machine user. Add the machine account as a collaborator or add the machine user to a team with access to the repositories.
Adobe recommends adding and merging this code to your project Git repositories. If you do not configure the connection, you will have build issues.
To find your project SSH public key:
Log in to the Project Web Interface.
Click on the project.
Click next to the project name.
Click Deploy Key.
Copy the deploy key to the clipboard.
On GitHub, deploy keys are read-only by default.
To enter your project public key as a GitHub deploy key:
Log in to your GitHub repository as the administrator.
Click the repository Settings tab.
If you do not see this option, you are not signed in as the repository administrator and you cannot complete this task. Ask your GitHub repository administrator to do this.
On the Settings tab in the left navigation bar, click Deploy Keys.
Click Add deploy key.
Follow the prompts to complete the task.
In composer.json
, use the <user>@<host>:<.git</code>
format, or ssh://<user>@<host>:<port>/<path>.git
if using a non-standard port.
To enter your project public key as a Bitbucket deploy key:
To add the public SSH key for your project as a GitLab deploy key:
Log in to your GitLab repository as the owner.
Verify that the Pipelines option is enabled for your project:
Add your public SSH key to the CI/CD settings.
You can access your project and environments from any location through a web browser using the Project Web Interface. You may have security set for your Production environment, stores, and sites. This section helps you secure your Integration and Staging environments for strictly your developers, DBAs, and more.
DO NOT use the following methods for securing Pro Staging and Production environments. This breaks Fastly caching. You must use the Blocking feature available in the Fastly CDN for Adobe Commerce.
To secure environments:
Log into your Project Web Interface.
Click on the project.
Select an environment branch.
Click Configure Environment.
On the Settings tab, click ON for HTTP access control to enable secure access. You can choose between credentials or IP addresses to filter for access.
To filter by credentials, click Add Login, enter a username and password, and click again Add Login to add.
To filter by IP address, enter the IP addresses in a list with deny
or allow
. For example:
123.456.789.111/29 allow
123.456.789.112/29 allow
234.123.567.111/29 allow
0.0.0.0/0 deny
Click Save.
The branch redeploys to update the environment security and settings. Adobe recommends testing your environments after completing security settings.