An Adobe Commerce on cloud infrastructure project includes essential files for credentials and application configuration. These files are available in as template according to the Adobe Commerce version. See the cloud templates based on Adobe Commerce version in the magento/magento-cloud
GitHub repository.
The following table describes the files included in a cloud project:
File | Description |
---|---|
/.magento/routes.yaml |
Configuration file that redirects www to the apex domain and php application to serve HTTP. See Configure routes. |
/.magento/services.yaml |
Configuration file that defines a MySQL instance (MariaDB), Redis, and OpenSearch or Elasticsearch. See Configure services. |
/app |
The code folder is used for custom modules. The design folder is used for custom themes. The etc folder contains configuration files for the application. |
/m2-hotfixes |
Used for custom patches. |
/update |
A service folder used by the support module. |
.gitignore |
Specify which files and directories to ignore. See .gitignore reference. |
.magento.app.yaml |
Configuration file that defines the properties to build your application. See Configure application. |
.magento.env.yaml |
Configuration file for the build, deploy, and post-deploy phases. The ece-tools package includes a sample of this file. See Configure environments. |
composer.json |
Fetches Adobe Commerce and the configuration scripts to prepare your application. See Required packages. |
composer.lock |
Stores version dependencies for every package. See Required packages. |
magento-vars.php |
A file used to define multiple stores and sites using variables. |
When you push your local changes to the remote server, the deploy script uses the values defined by configuration files in the .magento
directory, then the script deletes the directory and its contents. Your local development environment is not affected.
The location of the application root directory depends on the environment.
/app
/<project-ID>
/<project-ID>_stg
/<project-ID>
The remote Integration, Staging, and Production environments are read only. The following directories are the only writable directories for security reasons:
var
pub/static
pub/media
app/etc
/tmp
In Production and Staging environments, each node in the three-node cluster has a /tmp
directory that is not shared with the other nodes.
There is a base .gitignore
file with the Adobe Commerce on cloud infrastructure project repository. See the latest .gitignore file in the magento-cloud repository. To add a file that is in the ignore list, you can use the -f
(force) option when staging a commit:
git add <path/filename> -f
You can use the following steps to change the structure of an existing project to reflect the latest base template for Adobe Commerce on cloud infrastructure.
Clone project to local workstation.
Update the composer.json
file with the following values for the extra
section.
"extra": {
"magento-force": true
"magento-deploystrategy": "copy"
}
Add the .gitignore
file designed for the base template. For example, if you need the .gitignore
file for the version 2.2.6 template, use the .gitignore for 2.2.6 file as a reference.
Clear the git cache.
git rm -r --cached .
Add and commit changes.
git add -A && git commit -m "Update base template"
The deployment process begins when you perform a merge, push, or synchronization of your environment, or when you trigger a manual redeployment, during which the Commerce application is in maintenance mode. For a Production environment, Adobe recommends completing this work during off-peak hours to avoid service disruptions.