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

Commit c43177a

Browse files
authored
MAGECLOUD-2114 fix YAML formatting (#4574)
* MAGECLOUD-2114 fix YAML formatting * fix typos * Adding other YAML files In further conversation, decided to add other significant YAML samples in the check. * fix formatting, spacing issues
1 parent d5df58b commit c43177a

25 files changed

+404
-474
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#### To verify information used for configurations and settings:
2+
3+
1. Use SSH to log in to the remote environment.
4+
5+
1. Create `pretty-print` of all relationships for services and configuration data for that environment.
6+
7+
```bash
8+
php -r 'print_r(json_decode(base64_decode($_ENV["MAGENTO_CLOUD_RELATIONSHIPS"])));'
9+
```
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
You can use the following instructions for service setup on {{site.data.var.ece}} Pro Integration environments and Starter environments including Production `master`. You must submit a support ticket to configure the service on Pro Production and Staging environments. See [Services]({{ page.baseurl }}/cloud/project/project-conf-files_services.html).
1+
You can use the following instructions for service setup on {{site.data.var.ece}} Pro Integration environments and Starter environments, including `master` branch. You must submit a support ticket to configure the service on Pro Production and Staging environments. See [Services]({{ page.baseurl }}/cloud/project/project-conf-files_services.html).

guides/v2.1/cloud/configure/setup-cron-jobs.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ crons:
3333
The following example is the default cron included for {{site.data.var.ece}}.
3434
3535
```yaml
36-
# Default Magento 2 cron job
37-
3836
crons:
3937
cronrun:
4038
spec: "* * * * *"
@@ -89,8 +87,6 @@ The default cron interval for all environments provisioned in the us-3, eu-3, an
8987
We include a default cron job for Magento in the default file:
9088

9189
```yaml
92-
# Default Magento 2 cron jobs
93-
9490
crons:
9591
cronrun:
9692
spec: "* * * * *"

guides/v2.1/cloud/env/environment-vars_magento.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,25 @@ functional_areas:
66
- Configuration
77
---
88

9-
Users that have administrative access to the {{site.data.var.ece}} project can use the
10-
following project environment variables to override the configuration settings
11-
for the administrative user account to access the Admin UI. See [Change the Magento ADMIN variables]({{ page.baseurl }}/cloud/before/before-setup-env-2_clone.html#change-the-magento-admin-variables).
9+
Users that have administrative access to the {{site.data.var.ece}} project can use the following project environment variables to override the configuration settings for the administrative user account to access the Admin UI. See [Change the Magento ADMIN variables]({{ page.baseurl }}/cloud/before/before-setup-env-2_clone.html#change-the-magento-admin-variables).
1210

1311
## Admin credentials
1412

1513
Use the ADMIN variables in the following table to override credentials for the Magento Admin user during installation.
1614

1715
If you want to change the values after installation, connect to your environment using ssh and use the the Magento CLI [`admin:user` command]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-admin.html) to create or edit the Magento Admin user credentials.
1816

19-
| Variable | Default | Description |
20-
|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
17+
| Variable | Default | Description |
18+
| -------- | -------- | ----------- |
2119
| `ADMIN_USERNAME`| License Owner email address | A username for the administrative user with the ability to create other users, including administrative users.|
2220
|`ADMIN_EMAIL`| | Email address for the administrative user. This address is used to send password reset notifications.|
2321
|`ADMIN_PASSWORD`| | Password for the administrative user. When the project is created a random password is generated and an email is sent to the {{ site.data.var.ece }} License Owner. During project creation, the License Owner should have already changed the password. You might need to contact the License Owner for the updated password.|
2422
| `ADMIN_LOCALE` | `en_US` | The default locale used by the Magento Admin.
2523

26-
27-
2824
## Admin URL
2925

3026
Use the following environment variable to secure access to your Magento Admin UI. If specified, this value overrides the default URL during installation.
3127

3228
`ADMIN_URL`—The relative URL to access the Magento Admin UI. The default URL is `/admin`. For security reasons, Magento recommends that you change the default to a unique, custom Admin URL that is not easy to guess.
3329

34-
If you need to change the Admin URL after installation, connect to your environment using ssh and use the Magento CLI [`magento setup:config`]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-deployment.html) command to change the URL.
30+
If you need to change the Admin URL after installation, connect to your environment using SSH and use the Magento CLI [`magento setup:config`]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-deployment.html) command to change the URL.

guides/v2.1/cloud/env/setup-notifications.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ To configure notifications:
3636
```yaml
3737
log:
3838
slack:
39-
token: "<your-slack-token>"
40-
channel: "<your-slack-channel>"
41-
username: "SlackHandler"
42-
min_level: "info"
39+
token: "<your-slack-token>"
40+
channel: "<your-slack-channel>"
41+
username: "SlackHandler"
42+
min_level: "info"
4343
email:
44-
to: <your-email>
45-
from: <your-email>
46-
subject: "Log notification from Magento Cloud"
47-
min_level: "notice"
44+
to: <your-email>
45+
from: <your-email>
46+
subject: "Log notification from Magento Cloud"
47+
min_level: "notice"
4848
```
4949
5050
{:.bs-callout .bs-callout-info}
@@ -67,10 +67,10 @@ The following example shows a Slack-only configuration:
6767
```yaml
6868
log:
6969
slack:
70-
token: "<your-slack-token>"
71-
channel: "<your-slack-channel>"
72-
username: "SlackHandler"
73-
min_level: "info"
70+
token: "<your-slack-token>"
71+
channel: "<your-slack-channel>"
72+
username: "SlackHandler"
73+
min_level: "info"
7474
```
7575

7676
- `token`—Your Slack [user token](https://api.slack.com/docs/token-types#user). Your user token authorizes {{site.data.var.ece}} to send messages.
@@ -88,10 +88,10 @@ The following example shows an email-only configuration:
8888
```yaml
8989
log:
9090
email:
91-
to: <your-email>
92-
from: <your-email>
93-
subject: "Log notification from Magento Cloud"
94-
min_level: "notice"
91+
to: <your-email>
92+
from: <your-email>
93+
subject: "Log notification from Magento Cloud"
94+
min_level: "notice"
9595
```
9696

9797
- `to`—Email address {{site.data.var.ece}} sends notification messages.

guides/v2.1/cloud/env/variables-deploy.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,17 @@ The following example merges new values to an existing configuration:
179179
```yaml
180180
stage:
181181
deploy:
182-
QUEUE_CONFIGURATION:
183-
_merge: true
184-
amqp:
185-
host: changed1.host
186-
port: 5672
187-
amqp2:
188-
host: changed2.host2
189-
port: 12345
190-
mq:
191-
host: changedmq.host
192-
port: 1234
182+
QUEUE_CONFIGURATION:
183+
_merge: true
184+
amqp:
185+
host: changed1.host
186+
port: 5672
187+
amqp2:
188+
host: changed2.host2
189+
port: 12345
190+
mq:
191+
host: changedmq.host
192+
port: 1234
193193
```
194194

195195
### `REDIS_USE_SLAVE_CONNECTION`

guides/v2.1/cloud/env/variables-global.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ stage:
1313
global:
1414
GLOBAL_VARIABLE_NAME: value
1515
```
16+
1617
{% include cloud/customize-build-deploy.md %}
1718
1819
### `MIN_LOGGING_LEVEL`
@@ -24,8 +25,8 @@ Overrides the minimum logging level for all output streams without making change
2425

2526
```yaml
2627
stage:
27-
global:
28-
MIN_LOGGING_LEVEL: debug
28+
global:
29+
MIN_LOGGING_LEVEL: debug
2930
```
3031

3132
### `SCD_ON_DEMAND`
@@ -45,13 +46,14 @@ stage:
4546

4647
The `SCD_ON_DEMAND` variable skips the SCD and the `STATIC_CONTENT_SYMLINK` in both phases (build and deploy), clears the `pub/static` and `var/view_preprocessed` folders, and writes the following to the `app/etc/env.php` file:
4748

48-
```php
49+
```php?start_inline=1
4950
return array(
5051
...
5152
'static_content_on_demand_in_production' => 1,
5253
...
5354
);
5455
```
56+
{: .no-copy}
5557

5658
### `SKIP_HTML_MINIFICATION`
5759

@@ -87,7 +89,6 @@ Use the `X_FRAME_CONFIGURATION` variable to change the [`X-Frame-Options`]({{ pa
8789

8890
Add the `X_FRAME_CONFIGURATION` environment variable to the `global` stage in the `.magento.env.yaml` file:
8991

90-
9192
```yaml
9293
stage:
9394
global:

guides/v2.1/cloud/env/variables-post-deploy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Customize the list of pages used to preload the cache in the `post_deploy` stage
2626
stage:
2727
post-deploy:
2828
WARM_UP_PAGES:
29-
- "index.php"
30-
- "index.php/customer/account/create"
29+
- "index.php"
30+
- "index.php/customer/account/create"
3131
```
3232

3333
You must configure the post-deploy hook. See [hooks section of the `.magento.app.yaml` file]({{ page.baseurl }}/cloud/project/project-conf-files_magento-app.html#hooks).

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

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

2323
### `name`
24+
2425
{{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.
2526

2627
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.
@@ -29,6 +30,7 @@ The name is used in the [`routes.yaml`]({{ page.baseurl }}/cloud/project/project
2930
Do not change the name of an application after it has been deployed.
3031

3132
### `type` and `build`
33+
3234
The `type` and `build` properties provide information about the base container image to build and run the project.
3335

3436
The supported `type` language is {% glossarytooltip bf703ab1-ca4b-48f9-b2b7-16a81fd46e02 %}PHP{% endglossarytooltip %}. Specify the PHP version as follows:
@@ -45,6 +47,7 @@ build:
4547
```
4648

4749
### `access`
50+
4851
The _access_ property indicates a minimum user role level that is allowed SSH access to the environments. The available user roles are:
4952

5053
- `admin`—Can change settings and execute actions in the environment. Also has _contributor_ and _viewer_ rights.
@@ -59,9 +62,10 @@ access:
5962
```
6063

6164
### `relationships`
65+
6266
Defines the service mapping in your application.
6367

64-
The left-hand side is the name of the relationship as it will be exposed to the application in the `MAGENTO_CLOUD_RELATIONSHIPS` environment variable. The right-hand side is in the form `<service name>:<endpoint name>`, where `<service name>` comes from `.magento/services.yaml` and `<endpoint name>` should be the same as the value of `type` declared in that same file.
68+
The left-hand side is the name of the relationship as it will be exposed to the application in the `MAGENTO_CLOUD_RELATIONSHIPS` environment variable. The right-hand side is in the form `<service-name>:<endpoint-name>`, where `<service-name>` comes from `.magento/services.yaml` and `<endpoint-name>` should be the same as the value of `type` declared in that same file.
6569

6670
Example of valid options are:
6771

@@ -75,6 +79,7 @@ search: "searchengine:solr"
7579
See [Services]({{page.baseurl}}/cloud/project/project-conf-files_services.html) for a full list of currently supported service types and endpoints.
7680

7781
### `web`
82+
7883
The `web` property defines how your application is exposed to the web (in HTTP). It determines how the web application serves content— from the front-controller script to a non-static request to an `index.php` file on the root. We support any directory structure so the static file can be in a sub directory, and the `index.php` file can be further down.
7984

8085
You can specify the following attributes for the `web` property:
@@ -141,6 +146,7 @@ web:
141146
```
142147

143148
### `disk`
149+
144150
Defines the persistent disk size of the application in MB.
145151

146152
```yaml
@@ -151,6 +157,7 @@ disk: 2048
151157
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.
152158

153159
### `mounts`
160+
154161
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:
155162

156163
```yaml
@@ -177,6 +184,7 @@ Important: The subpath portion of the mount is the unique identifier of the file
177184
You can make the mount web accessible by adding it to the [`web`](#web) block of locations.
178185

179186
### `dependencies`
187+
180188
Enables you to specify dependencies that your application might need during the build process.
181189

182190
{{site.data.var.ee}} supports dependencies on the following
@@ -198,10 +206,13 @@ nodejs:
198206
```
199207

200208
### `hooks`
209+
201210
Use the `hooks` section to run shell commands during the build, deploy, and post-deploy phases:
202211

203212
- **`build`**—Execute commands _before_ packaging your application. Services, such as the database or Redis, are not available at this time since the application has not been deployed yet. You must add custom commands _before_ the default `php ./vendor/bin/ece-tools` command so that custom-generated content continues to the deployment phase.
213+
204214
- **`deploy`**—Execute commands _after_ packaging and deploying your application. You can access other services at this point. Since the default `php ./vendor/bin/ece-tools` command copies the `app/etc` directory to the correct location, you must add custom commands _after_ the deploy command to prevent custom commands from failing.
215+
205216
- **`post_deploy`**—Execute commands _after_ deploying your application and _after_ the container begins accepting connections. The `post_deploy` hook clears the cache and preloads (warms) the cache. You can customize the list of pages using the `WARM_UP_PAGES` variable in the [Post-deploy stage]({{ site.baseurl }}/guides/v2.1/cloud/env/variables-post-deploy.html). It is available only for Pro projects that contain [Staging and Production environments in the Project Web UI]({{ page.baseurl }}/cloud/trouble/pro-env-management.html) and for Starter projects. Although not required, this works in tandem with the `SCD_ON_DEMAND` environment variable.
206217

207218
Add CLI commands under the `build`, `deploy`, or `post_deploy` sections _before_ the `ece-tools` command:
@@ -242,9 +253,9 @@ The commands run from the application (`/app`) directory. You can use the `cd` c
242253
```yaml
243254
dependencies:
244255
ruby:
245-
sass: "3.4.7"
256+
sass: "3.4.7"
246257
nodejs:
247-
grunt-cli: "~0.1.13"
258+
grunt-cli: "~0.1.13"
248259
249260
hooks:
250261
build: |
@@ -258,6 +269,7 @@ hooks:
258269
You must compile Sass files using `grunt` before static content deployment, which happens during the build. Place the `grunt` command before the `build` command.
259270

260271
### `crons`
272+
261273
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.
262274

263275
`crons` support the following:
@@ -291,10 +303,10 @@ The following environment variables are included in `.magento.app.yaml`. These a
291303

292304
```yaml
293305
variables:
294-
env:
295-
CONFIG__DEFAULT__PAYPAL_ONBOARDING__MIDDLEMAN_DOMAIN: 'payment-broker.magento.com'
296-
CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL: 'Magento_Enterprise_Cloud_BT'
297-
CONFIG__STORES__DEFAULT__PAYPAL__NOTATION_CODE: 'Magento_Enterprise_Cloud'
306+
env:
307+
CONFIG__DEFAULT__PAYPAL_ONBOARDING__MIDDLEMAN_DOMAIN: 'payment-broker.magento.com'
308+
CONFIG__STORES__DEFAULT__PAYMENT__BRAINTREE__CHANNEL: 'Magento_Enterprise_Cloud_BT'
309+
CONFIG__STORES__DEFAULT__PAYPAL__NOTATION_CODE: 'Magento_Enterprise_Cloud'
298310
```
299311

300312
## Configure PHP options
@@ -317,27 +329,31 @@ You can define additional PHP extensions to enable or disable:
317329

318330
```yaml
319331
runtime:
320-
extensions:
321-
- xdebug
322-
- redis
323-
- ssh2
324-
disabled_extensions:
325-
- sqlite3
332+
extensions:
333+
- xdebug
334+
- redis
335+
- ssh2
336+
disabled_extensions:
337+
- sqlite3
326338
```
327339

328-
To view the current list of PHP extensions, SSH into your environment and enter the following command:
340+
#### To view the current list of PHP extensions:
329341

330-
php -m
342+
Use SSH to log in to your environment and list the PHP extensions as follows:
343+
344+
```bash
345+
php -m
346+
```
331347

332348
Magento requires the following PHP extensions that are enabled by default:
333349

334350
- [curl](http://php.net/manual/en/book.curl.php)
335351
- [gd](http://php.net/manual/en/book.image.php)
336352
- [intl](http://php.net/manual/en/book.intl.php)
337-
- PHP 7 only:
353+
- PHP 7 only:
354+
- [json](http://php.net/manual/en/book.json.php)
355+
- [iconv](http://php.net/manual/en/book.iconv.php)
338356

339-
- [json](http://php.net/manual/en/book.json.php)
340-
- [iconv](http://php.net/manual/en/book.iconv.php)
341357
- [mcrypt](http://php.net/manual/en/book.mcrypt.php)
342358
- [PDO/MySQL](http://php.net/manual/en/ref.pdo-mysql.php)
343359
- [bc-math](http://php.net/manual/en/book.bc.php)
@@ -396,10 +412,14 @@ Configuring PHP settings improperly can cause issues. We recommend only advanced
396412

397413
For example, if you need to increase the PHP memory limit:
398414

399-
memory_limit = 756M
415+
```bash
416+
memory_limit = 756M
417+
```
400418

401419
For a list of recommended PHP configuration settings, see [Required PHP settings]({{ page.baseurl }}/install-gde/prereq/php-settings.html).
402420

403421
After pushing your file, you can check that the custom PHP configuration has been added to your environment by [creating an SSH tunnel]({{ page.baseurl }}/cloud/env/environments-start.html#env-start-tunn) to your environment and entering:
404422

405-
cat /etc/php5/fpm/php.ini
423+
```bash
424+
cat /etc/php5/fpm/php.ini
425+
```

0 commit comments

Comments
 (0)