Commit ac60dfc6 authored by Suzanne Selhorn's avatar Suzanne Selhorn Committed by Marcel Amirault

Docs: dotenv post-merge review

Related to: https://gitlab.com/gitlab-org/gitlab/-/issues/210593
parent 23f894fc
...@@ -173,8 +173,8 @@ If you want to use the environment URL in GitLab, you would have to update it ma ...@@ -173,8 +173,8 @@ If you want to use the environment URL in GitLab, you would have to update it ma
To address this problem, you can configure a deployment job to report back a set of To address this problem, you can configure a deployment job to report back a set of
variables, including the URL that was dynamically-generated by the external service. variables, including the URL that was dynamically-generated by the external service.
GitLab supports [dotenv](https://github.com/bkeepers/dotenv) file as the format, GitLab supports the [dotenv (`.env`)](https://github.com/bkeepers/dotenv) file format,
and expands the `environment:url` value with variables defined in the dotenv file. and expands the `environment:url` value with variables defined in the `.env` file.
To use this feature, specify the To use this feature, specify the
[`artifacts:reports:dotenv`](../pipelines/job_artifacts.md#artifactsreportsdotenv) keyword in `.gitlab-ci.yml`. [`artifacts:reports:dotenv`](../pipelines/job_artifacts.md#artifactsreportsdotenv) keyword in `.gitlab-ci.yml`.
...@@ -213,14 +213,13 @@ stop_review: ...@@ -213,14 +213,13 @@ stop_review:
As soon as the `review` job finishes, GitLab updates the `review/your-branch-name` As soon as the `review` job finishes, GitLab updates the `review/your-branch-name`
environment's URL. environment's URL.
It parses the report artifact `deploy.env`, registers a list of variables as runtime-created, It parses the `deploy.env` report artifact, registers a list of variables as runtime-created,
uses it for expanding `environment:url: $DYNAMIC_ENVIRONMENT_URL` and sets it to the environment URL. uses it for expanding `environment:url: $DYNAMIC_ENVIRONMENT_URL` and sets it to the environment URL.
You can also specify a static part of the URL at `environment:url:`, such as You can also specify a static part of the URL at `environment:url:`, such as
`https://$DYNAMIC_ENVIRONMENT_URL`. If the value of `DYNAMIC_ENVIRONMENT_URL` is `https://$DYNAMIC_ENVIRONMENT_URL`. If the value of `DYNAMIC_ENVIRONMENT_URL` is
`123.awesome.com`, the final result will be `https://123.awesome.com`. `example.com`, the final result will be `https://example.com`.
The assigned URL for the `review/your-branch-name` environment is visible in the UI. The assigned URL for the `review/your-branch-name` environment is [visible in the UI](#using-the-environment-url).
[See where the environment URL is displayed](#using-the-environment-url).
> **Notes:** > **Notes:**
> >
......
...@@ -114,14 +114,15 @@ The `dotenv` report collects a set of environment variables as artifacts. ...@@ -114,14 +114,15 @@ The `dotenv` report collects a set of environment variables as artifacts.
The collected variables are registered as runtime-created variables of the job, The collected variables are registered as runtime-created variables of the job,
which is useful to [set dynamic environment URLs after a job finishes](../environments/index.md#set-dynamic-environment-urls-after-a-job-finishes). which is useful to [set dynamic environment URLs after a job finishes](../environments/index.md#set-dynamic-environment-urls-after-a-job-finishes).
There are a couple of limitations on top of the [original dotenv rules](https://github.com/motdotla/dotenv#rules). There are a couple of exceptions to the [original dotenv rules](https://github.com/motdotla/dotenv#rules):
- The variable key can contain only letters, digits and underscore ('_'). - The variable key can contain only letters, digits, and underscores (`_`).
- The size of the dotenv file must be smaller than 5 kilobytes. - The maximum size of the `.env` file is 5 KB.
- The number of variables must be less than 10. - The maximum number of variables is 10.
- It does not support variable substitution in the dotenv file itself. - Variable substitution in the `.env` file is not supported.
- It does not support empty lines and comments (`#`) in dotenv file. - The `.env` file can't have empty lines or comments (starting with `#`).
- It does not support quote escape, spaces in a quote, a new line expansion in a quote, in dotenv file. - Key values in the `env` file cannot have spaces or newline characters (`\n`), including when using single or double quotes.
- Quote escaping during parsing (`key = 'value'` -> `{key: "value"}`) is not supported.
#### `artifacts:reports:cobertura` #### `artifacts:reports:cobertura`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment