Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 75c1f1d

Browse files
authored
MAGECLOUD-2126 correct services and routes yaml notes (#2005)
* MAGECLOUD-2126 correct services and routes yaml notes * fix statement * fix values as advised * Enhanced the access property info, incorporate edits from review * fixed mounts * typo * typo
1 parent 714bc38 commit 75c1f1d

6 files changed

+152
-161
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="bs-callout bs-callout-info" id="info" markdown="1">
2+
For Pro projects, the changes you make using this YAML file affects your Integration environment only. To make these changes in a Staging or Production environment, you must create a [Support ticket](http://support.magento.com){:target="_blank"}.
3+
</div>

guides/v2.1/cloud/project/project-conf-files_magento-app.md

Lines changed: 63 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,39 @@ The `.magento.app.yaml` has many default values, see [a sample `.magento.app.yam
2222
Use the following properties to build your application configuration file. The `name`, `type`, `disk`, and one `web` or `worker` block is required.
2323

2424
### `name`
25-
{{site.data.var.ee}} supports multiple applications in a project, so you need a unique name that identifies the application in the project.
25+
{{site.data.var.ee}} supports multiple applications in a project, so you need a unique name that identifies the application in the project. You must use lower case alphanumeric characters, such as `a` to `z` and `0` to `9` for the name.
2626

27-
The `name` property can consist only of lower case alphanumeric characters, such as `a` to `z` and `0` to `9`. The name is used in the [`routes.yaml`]({{ page.baseurl }}/cloud/project/project-conf-files_routes.html) file to define the HTTP upstream (by default, `php:http`). For example, if the value of `name` is `app`, you must use `app:http` in the upstream field. You can also use this name in multi-application relationships.
27+
The name is used in the [`routes.yaml`]({{ page.baseurl }}/cloud/project/project-conf-files_routes.html) file to define the HTTP upstream (by default, `php:http`). For example, if the value of `name` is `app`, you must use `app:http` in the upstream field. You can also use this name in multi-application relationships.
2828

2929
{% include note.html type="info" content="Do not change the name of an application after it has been deployed." %}
3030

3131
### `type` and `build`
32-
The `type` and `build` properties are used to build and run the project. The only supported `type` currently is {% glossarytooltip bf703ab1-ca4b-48f9-b2b7-16a81fd46e02 %}PHP{% endglossarytooltip %}.
32+
The `type` and `build` properties provide information about the base container image to build and run the project.
3333

34-
Supported versions for 2.0.X to 2.1.X:
34+
The supported `type` language is {% glossarytooltip bf703ab1-ca4b-48f9-b2b7-16a81fd46e02 %}PHP{% endglossarytooltip %}. Specify the PHP version as follows:
3535

36-
```
37-
type: php:5.5
38-
type: php:5.6
36+
```yaml
3937
type: php:7.0
4038
```
4139
42-
The `build` property determines what happens by default when building the project. The only value currently supported is `composer`.
40+
The `build` property determines what happens by default when building the project. The `flavor` specifies a default set of build tasks to run. The supported flavor is `composer`.
4341

4442
```yaml
45-
type: php:7.0
4643
build:
4744
flavor: composer
4845
```
4946

5047
### `access`
51-
Defines the user roles who can log in using SSH to the environments to which they have access.
48+
The _access_ property indicates a minimum user role level that is allowed SSH access to the environments. The available user roles are:
5249

53-
Possible values are:
50+
- `admin`—Can change settings and execute actions in the environment. Also has _contributor_ and _viewer_ rights.
51+
- `contributor`—Can push code to this environment and branch from the environment. Also has _viewer_ rights.
52+
- `viewer`—Can view the environment only.
5453

55-
```
56-
ssh: admin
54+
The default user role is as follows:
55+
56+
```yaml
5757
ssh: contributor
58-
ssh: viewer
5958
```
6059

6160
### `relationships`
@@ -84,7 +83,7 @@ Supports the following:
8483
* `index_files`: To use a static file (for example, `index.html`) to serve your application. This key expects a collection. For this to work, the static file(s) should be included in your whitelist. For example, to use a file named `index.html` as an index file, your whitelist should include an element that matches the filename, like `- \.html$`.
8584
* `blacklist`: A list of files that should never be executed. Has no effect on static files.
8685
* `whitelist`: A list of static files (as regular expressions) that can be served. Dynamic files (for example, PHP files) are treated as static files and have their source code served, but they are not executed.
87-
* `expires`: The number of seconds whitelisted (that is, static) content should be cached by the browser. This enables the cache-control and expires headers for static content. The `expires` directive and resulting headers are left out entirely if this isn't set.
86+
* `expires`: The number of seconds whitelisted (that is, static) content should be cached by the browser. This enables the cache-control and expires headers for static content. The `expires` directive and resulting headers are left out entirely if this is not set.
8887

8988
Contrary to standard `.htaccess` approaches, which accept a *blacklist* and allow everything to be accessed except a specific list, we accept a *whitelist*, which means that anything not matched will trigger a 404 error and will be passed through to your `passthru` URL.
9089

@@ -98,46 +97,48 @@ The following displays the default set of web accessible locations associated wi
9897
```yaml
9998
# The configuration of app when it is exposed to the web.
10099
web:
101-
locations:
102-
"/":
103-
# The public directory of the app, relative to its root.
104-
root: "pub"
105-
# The front-controller script to send non-static requests to.
106-
passthru: "/index.php"
107-
index:
108-
- index.php
109-
expires: -1
110-
scripts: true
111-
allow: false
112-
rules:
113-
\.(css|js|map|hbs|gif|jpe?g|png|tiff|wbmp|ico|jng|bmp|svgz|midi?|mp?ga|mp2|mp3|m4a|ra|weba|3gpp?|mp4|mpe?g|mpe|ogv|mov|webm|flv|mng|asx|asf|wmv|avi|ogx|swf|jar|ttf|eot|woff|otf|html?)$:
114-
allow: true
115-
/robots\.txt$:
116-
allow: true
117-
"/media":
118-
root: "pub/media"
119-
allow: true
120-
scripts: false
121-
passthru: "/index.php"
122-
"/static":
123-
root: "pub/static"
124-
allow: true
125-
scripts: false
126-
passthru: "/front-static.php"
127-
rules:
128-
^/static/version\d+/(?<resource>.*)$:
129-
passthru: "/static/$resource"
100+
locations:
101+
"/":
102+
# The public directory of the app, relative to its root.
103+
root: "pub"
104+
# The front-controller script to send non-static requests to.
105+
passthru: "/index.php"
106+
index:
107+
- index.php
108+
expires: -1
109+
scripts: true
110+
allow: false
111+
rules:
112+
\.(css|js|map|hbs|gif|jpe?g|png|tiff|wbmp|ico|jng|bmp|svgz|midi?|mp?ga|mp2|mp3|m4a|ra|weba|3gpp?|mp4|mpe?g|mpe|ogv|mov|webm|flv|mng|asx|asf|wmv|avi|ogx|swf|jar|ttf|eot|woff|otf|html?)$:
113+
allow: true
114+
/robots\.txt$:
115+
allow: true
116+
"/media":
117+
root: "pub/media"
118+
allow: true
119+
scripts: false
120+
passthru: "/index.php"
121+
"/static":
122+
root: "pub/static"
123+
allow: true
124+
scripts: false
125+
passthru: "/front-static.php"
126+
rules:
127+
^/static/version\d+/(?<resource>.*)$:
128+
passthru: "/static/$resource"
130129
```
131130

132131
### `disk`
133-
Defines the size of the persistent disk size of the application in MB.
132+
Defines the persistent disk size of the application in MB.
133+
134+
```yaml
135+
disk: 256
136+
```
134137

135138
{% include note.html type="info" content="The minimal recommended disk size is 256MB. If you see the error `UserError: Error building the project: Disk size may not be smaller than 128MB`, increase the size to 256MB." %}
136139

137140
### `mounts`
138-
An object whose keys are paths relative to the root of the application. The mount is a writable area on the disk for files. It's in the form `volume_id[/subpath]`.
139-
140-
The following is a default list of mounts configured in `magento.app.yaml`:
141+
An object whose keys are paths relative to the root of the application. The mount is a writable area on the disk for files. The following is a default list of mounts configured in the `magento.app.yaml` file using the `volume_id[/subpath]` syntax:
141142

142143
```yaml
143144
# The mounts that will be performed when the package is deployed.
@@ -154,12 +155,12 @@ The format for adding your mount to this list is as follows:
154155
"/public/sites/default/files": "shared:files/files"
155156
```
156157

157-
* `shared` means that the volume is shared between your applications inside an environment.
158-
* `disk` key defines the size available for that `shared` volume
158+
- `shared`—Shares a volume between your applications inside an environment.
159+
- `disk`—Defines the size available for the shared volume.
159160

160161
{% include note.html type="info" content="The subpath portion of the mount is the unique identifier of the files area. If changed, files at the old location will be permanently lost. Do not change this value once your site has data unless you really want to lose all existing data."%}
161162

162-
If you also want the mount web accessible, you must add it to the [`web`](#web) block of locations.
163+
Also, if you want the mount web accessible, you must add it to the [`web`](#web) block of locations.
163164

164165
### `dependencies`
165166
Enables you to specify dependencies that your application might need during the build process.
@@ -210,24 +211,24 @@ The commands run from the application (`/app`) directory. You can use the `cd` c
210211

211212
```yaml
212213
dependencies:
213-
ruby:
214-
sass: "3.4.7"
215-
nodejs:
216-
grunt-cli: "~0.1.13"
214+
ruby:
215+
sass: "3.4.7"
216+
nodejs:
217+
grunt-cli: "~0.1.13"
217218
218219
hooks:
219-
build: |
220-
cd public/profiles/project_name/themes/custom/theme_name
221-
npm install
222-
grunt
223-
cd
224-
php ./bin/magento magento-cloud:build
220+
build: |
221+
cd public/profiles/project_name/themes/custom/theme_name
222+
npm install
223+
grunt
224+
cd
225+
php ./bin/magento magento-cloud:build
225226
```
226227

227228
You must compile SASS files using `grunt` before static content deployment, which happens during the build. Place the `grunt` command before the `build` command.
228229

229230
### `crons`
230-
`crons` describes processes that are triggered on a schedule. We recommend you run cron as the [Magento file system owner]({{ page.baseurl }}/cloud/before/before-workspace-file-sys-owner.html). Do not run cron as `root`. We also recommend against running cron as the web server user.
231+
Describes processes that are triggered on a schedule. We recommend you run cron as the [Magento file system owner]({{ page.baseurl }}/cloud/before/before-workspace-file-sys-owner.html). Do _not_ run cron as `root`or as the web server user.
231232

232233
More information about crons:
233234

guides/v2.1/cloud/project/project-conf-files_routes.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ functional_areas:
88
- Setup
99
---
1010

11-
{{site.data.var.ee}} processes an incoming {% glossarytooltip a05c59d3-77b9-47d0-92a1-2cbffe3f8622 %}URL{% endglossarytooltip %} using a *route*. The `routes.yaml` file—located at `.magento/routes.yaml` in your project—defines routes for Integration, Staging, and Production environments.
11+
{{site.data.var.ee}} processes an incoming URL using a *route*. The `routes.yaml` file—located at `.magento/routes.yaml` in your project—defines routes for the Integration environment. The deploy script uses values defined in the configuration files in the `.magento` directory and deletes the directory after deployment. Your local workspace is not affected.
1212

13-
The deploy script uses values defined in the configuration files in the `.magento` directory. The script deletes the directory after deployment. Your local workspace is not affected.
14-
15-
{% include cloud/note-pro-using-yaml.md %}
13+
{% include cloud/note-pro-using-yaml-support.md %}
1614

1715
The following is the default `routes.yaml` file:
1816

@@ -26,7 +24,7 @@ If you do not create a custom `routes.yaml` file, the automated deployment uses
2624

2725
#### To list the configured routes:
2826

29-
```
27+
```bash
3028
magento-cloud environment:routes
3129
3230
+-------------------+----------+---------------+

guides/v2.1/cloud/project/project-conf-files_services.md

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,11 @@ functional_areas:
88
- Setup
99
---
1010

11-
We provide a `services.yaml` file to configure all of your services supported and used by {{site.data.var.ece}}. These services include MySQL, PHP, Redis, ElasticSearch (for 2.1.X and later), and so on. You don't need to subscribe to external service providers.
11+
Use the `services.yaml` file to configure all of your services supported and used by {{site.data.var.ece}}. These services include MySQL, Redis, ElasticSearch (for 2.1.X and later), and so on. You do not need to subscribe to external service providers.This file is located in the `.magento` directory in your project. See the latest sample of the [`services.yaml`](https://github.com/magento/magento-cloud/blob/master/.magento/services.yaml){:target="_blank"} file.
1212

13-
This file is located at `.magento/services.yaml` in your project.
13+
When you push your Git branch, our deploy script uses the values defined by configuration files in the `.magento` directory. After deployment, the script deletes the directory and its contents. Your local development environment is not affected.
1414

15-
<div class="bs-callout bs-callout-info" id="info">
16-
<p>When you push your Git branch, our deploy script uses the values defined by configuration files in the <code>.magento</code> directory. After deployment, the script deletes the directory and its contents. Your local development environment isn't affected.</p>
17-
</div>
18-
19-
To see an example, see this [sample `services.yaml` file](https://github.com/magento/magento-cloud/blob/master/.magento/services.yaml){:target="_blank"}.
20-
21-
**For Pro:**
22-
23-
{% include cloud/note-pro-using-yaml.md %}
24-
25-
The following sections discuss properties in `services.yaml`.
15+
{% include cloud/note-pro-using-yaml-support.md %}
2616

2717
## How this file works {#howitworks}
2818
The `.magento.app.yaml` and `services.yaml` files set the services, applications, and configurations to build and include in an environment. If you add services with specific versions, the initial push and deployment of your branches with these updated files directs the PaaS environment to provision the environment with those services. When you make changes to the services, the environment updates.
@@ -35,18 +25,20 @@ This affects the following environments:
3525
To install and update services in Pro Staging and Production environments (IaaS), you must enter a [Support ticket]({{ page.baseurl }}/cloud/trouble/trouble.html). Indicate the service changes needed and your updated `.magento.app.yaml` and `services.yaml` files in the ticket.
3626

3727
## Default services {#cloud-yaml-services-default}
38-
Your Git branch includes the following default `services.yaml` file:
28+
The following is the default `services.yaml` file:
3929

40-
mysql:
41-
type: mysql:10.0
42-
disk: 2048
30+
```yaml
31+
mysql:
32+
type: mysql:10.0
33+
disk: 2048
4334

44-
redis:
45-
type: redis:3.0
35+
redis:
36+
type: redis:3.0
4637

47-
solr:
48-
type: solr:4.10
49-
disk: 1024
38+
solr:
39+
type: solr:4.10
40+
disk: 1024
41+
```
5042
5143
Modify this file to use specific and additional services in your deployment. See the [`type`](#cloud-yaml-services-type) section to see the services we support and deploy for you if you add them to the file.
5244

0 commit comments

Comments
 (0)