-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refacto on YAML config pages (#3697)
* split YAML doc pages, adding YAML structure for Upsun and solving small display issues * solve schema structure * change name of first top level yaml key to avoid confusion * P.sh YAML structure * remove duplicate lines * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/platform/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/platform/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/platform/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/platform/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/platform/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/platform/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/platform/src/learn/overview/yaml/platform-yaml-tags.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/friday/src/learn/overview/yaml/yaml-structure.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Update sites/platform/src/learn/overview/get-support.md Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> * solve issue on link to express getting start guide * solve issue on link to express getting start guide * remove Express link as it does not exist on Upsun side * remove Express link as it does not exist on Upsun side * exclude file in alphabetical order * test with app-reference.html * test path with app-reference.md * test path app-reference.md * revert and keep .md * revert and keep .md * changing app-reference.md back to .html * Apply suggestions from code review Anouck's review Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> --------- Co-authored-by: AnouckColson <113913013+AnouckColson@users.noreply.github.com> Co-authored-by: Chad Carlson <chadwcarlson@users.noreply.github.com>
- Loading branch information
1 parent
3c8890d
commit 8cde55e
Showing
16 changed files
with
340 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
title: "{{% vendor/name %}} YAML structure" | ||
weight: -5 | ||
description: "A description of the YAML file for {{% vendor/name %}}." | ||
--- | ||
|
||
In addition to the [basic functions you should be familiar with](./what-is-yaml.md), YAML structure is important. | ||
{{% vendor/name %}} accepts a specific structure for YAML configuration files. | ||
|
||
## YAML file location | ||
|
||
When you run the [`upsun project:init` command](/get-started/express/_index.md#configure-your-project), a default ``config.yaml`` file is generated in the `.upsun` folder. It contains the minimum default configuration based on your detected local stack. | ||
This YAML file is located in your ``.upsun`` directory, at the root of your project source code, and is a good starting point before customization. | ||
|
||
```bash | ||
. | ||
├── {{< vendor/configdir >}} | ||
| └── {{< vendor/configfile "apps" "strip" >}} | ||
└── <source code> | ||
``` | ||
## Mandatory top-level keys | ||
In the ``config.yaml`` file, there are only three mandatory top-level YAML keys: | ||
- ``applications``: this section of the file contains all of your [app definitions](/create-apps/app-reference.html) | ||
- ``routes``: this section of the file contains all of your [route definitions](/define-routes.md) (for each of your apps) | ||
- ``services``: this section of the file contains all of your [service definitions](/add-services.md) (for each of your apps) | ||
|
||
This looks like: | ||
```yaml {location="{{< vendor/configfile "apps" >}}"} | ||
{{< code-link destination="/create-apps/app-reference.md" text="applications" title="Complete list of all available properties" >}}: | ||
app: | ||
... | ||
|
||
{{< code-link destination="/add-services.html#available-services" text="services" title="Click to see the complete list of all available services" >}}: | ||
mariadb: | ||
type: mariadb:10.6 # All available versions are: 10.6, 10.5, 10.4, 10.3 | ||
|
||
{{< code-link destination="/define-routes.md" text="routes" title="The routes of the project. Each route describes how an incoming URL is going to be processed by Upsun (Staging). Click for more information." >}}: | ||
"https://{default}/": | ||
type: upstream | ||
upstream: "app:http" | ||
``` | ||
Below these three top-level key sections, you can use any of the [available YAML tags](./yaml-structure.md) you need. | ||
{{% note %}} | ||
Any YAML files located at the first level of your ``.upsun`` folder, at the root of your project source code, are taken in account. See [Rules on YAML files](#rules-on-yaml-files). | ||
{{% /note %}} | ||
## Rules on YAML files | ||
The following rules apply to YAML files contained in the ``.upsun`` folder: | ||
- All the existing YAML files located at the first level of the ``.upsun`` folder are taken into account. | ||
- All the existing YAML files located at the first level of the ``.upsun`` folder must feature the [mandatory top-level keys](#mandatory-top-level-keys), and must contain a [valid YAML configuration](/create-apps/app-reference.md). | ||
- All the YAML files in subdirectories of the ``.upsun`` folder need to be [manually imported](/learn/overview/yaml/platform-yaml-tags.md#include) and contain a [valid YAML configuration](/create-apps/app-reference.md). | ||
{{% note title="Warning" theme="warning"%}} | ||
When {{% vendor/name %}} combines all the YAML files located at the first level of the ``.upsun`` folder, only the top-level keys (`applications`, `services`, and `routes`) are merged. So if you define an app named ``app`` in two different YAML files, {{% vendor/name %}} only takes the second one into account. | ||
|
||
Example: | ||
```yaml {location=".upsun/app.yaml"} | ||
applications: | ||
app: | ||
type: nodejs:16 | ||
source: | ||
root: folder1 | ||
... | ||
``` | ||
|
||
```yaml {location=".upsun/app-bis.yaml"} | ||
applications: | ||
app: | ||
type: nodejs:20 | ||
build: | ||
flavor: none | ||
... | ||
``` | ||
|
||
Once {{% vendor/name %}} has combined the two configuration files, | ||
the blended configuration will be the following: | ||
```yaml {location="YAML config result"} | ||
applications: | ||
app: | ||
type: nodejs:20 | ||
build: | ||
flavor: none | ||
... | ||
``` | ||
|
||
Note that ``source.root`` (and any other `.upsun/app.yaml` parameters) will *not* be included in the final configuration. | ||
|
||
{{% /note %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.