Commit 44866ef1 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

docs: use top base job to enable multiple environments

parent ed22c6d9
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -226,20 +226,20 @@ The AWS template allows deploying multiple environments in parallel. Use cases o
- multi-instances deployment of the same application.

This feature can be enabled using the [parallel matrix jobs](https://docs.gitlab.com/ee/ci/yaml/#parallelmatrix)
pattern at the `.aws-env-base` job level (this is the top parent job of all deployment jobs). 
pattern at the `.aws-base` job level (the template's base job). 
Environments namespacing is ensured by the `AWS_ENVIRONMENT_NAMESPACE` variable (must start with a slash `/`).

Here is the example of the `.gitlab-ci.yml` file for a project deploying both a frontend and a backend applications:

```yaml
.aws-env-base:
.aws-base:
  parallel:
    matrix:
      - AWS_ENVIRONMENT_NAMESPACE: "/front"
        # AWS deployment scripts are located in the ./front/ directory
        # Helm Chart is located in the ./front/ directory
        AWS_SCRIPTS_DIR: "front"
      - AWS_ENVIRONMENT_NAMESPACE: "/back"
        # AWS deployment scripts are located in the ./back/ directory
        # Helm Chart is located in the ./back/ directory
        AWS_SCRIPTS_DIR: "back"

# ⚠ on_stop must be unset when defining parallel:matrix environments