The above configuration will deploy 2 environments on each pipeline:
- on feature branches: `review/doc/$CI_COMMIT_REF_NAME` and `review/dev-guide/$CI_COMMIT_REF_NAME`
- on the integration branch: `integration/doc` and `integration/dev-guide`
- on the production branch: `staging/doc` and `staging/dev-guide` (and finally `production/doc` and `production/dev-guide`)
### Deployment output variables
As seen above, the S3 template may support up to 4 environments (`review`, `integration`, `staging` and `production`).
@@ -159,6 +209,16 @@ Each deployment job produces _output variables_ that are propagated to downstrea
They may be freely used in downstream jobs (for instance to run acceptance tests against the latest deployed environment).
> [!important]
> If [multiple environments](#multiple-environments-support) are configured, the output variables are prefixed with a
> sluggified value of the `S3_ENVIRONMENT_NAMESPACE` variable (stripped of punctuation characters and converted to lowercase):
>
> * `<namespace_slug>_environment_type`: set to the type of environment (`review`, `integration`, `staging` or `production`),
> * `<namespace_slug>_environment_name`: the application name (see below),
> * `<namespace_slug>_environment_url`: set to the environment URL (whether determined statically or dynamically).
>
> The output dotenv file will be `s3.env.<namespace_slug>` instead, and the dynamic variable `${environment_namespace}` can be used in your scripts and manifests to access the contextual value of `<namespace_slug>`.
## Configuration reference
### Secrets management
@@ -189,6 +249,7 @@ The S3 template uses some global configuration used throughout all jobs.
| :lock: `S3_SECRET_KEY` | Default S3 service Secret Key | **has to be defined** |
| `base-bucket-name` / `S3_BASE_BUCKET_NAME` | Base bucket name | `$CI_PROJECT_NAME` ([see GitLab doc](https://docs.gitlab.com/ci/variables/predefined_variables/)) |
| `prefix` / `S3_PREFIX` | Default S3 prefix to use as a root destination to upload objects in the S3 bucket | _none_ |
| `environment-namespace` / `S3_ENVIRONMENT_NAMESPACE` | Extra [GitLab environments](https://docs.gitlab.com/ci/environments/) namespace _(only required when deploying [multiple environments](#multiple-environments-support))_<br/>:warning: must start with a slash `/` | _none_ |
| `scripts-dir` / `S3_SCRIPTS_DIR` | Directory where S3 hook scripts are located | `.`|
"description":"Default S3 prefix to use as a root destination to upload objects in the S3 bucket"
},
{
"name":"S3_ENVIRONMENT_NAMESPACE",
"description":"Extra [GitLab environments](https://docs.gitlab.com/ci/environments/) namespace _(only required when deploying multiple environments)_\n\n:warning: must start with a slash `/`",
"advanced":true
},
{
"name":"S3_SCRIPTS_DIR",
"description":"Directory where S3 hook scripts are located",