summaryrefslogtreecommitdiff
path: root/doc/variables/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/variables/README.md')
-rw-r--r--doc/variables/README.md24
1 files changed, 23 insertions, 1 deletions
diff --git a/doc/variables/README.md b/doc/variables/README.md
index d61474a..cef5680 100644
--- a/doc/variables/README.md
+++ b/doc/variables/README.md
@@ -1,6 +1,11 @@
## Variables
When receiving a build from GitLab CI, the runner prepares the build environment.
-It starts by setting a list of **predefined variables** (Environment Variables) and a list of **user-defined variables** (Secure Variables)
+It starts by setting a list of **predefined variables** (Environment Variables) and a list of **user-defined variables**
+
+The precedence of variables override:
+1. Predefined variables
+2. YAML-defined variables
+3. Secure variables
### Predefined variables (Environment Variables)
@@ -36,6 +41,23 @@ export CI_SERVER_REVISION=""
export CI_SERVER_VERSION=""
```
+### YAML-defined variables
+**This feature requires `gitlab-runner` with version equal or greater than 0.5.0.**
+
+GitLab CI allows you to add to `.gitlab-ci.yml` variables that are set in build environment.
+The variables are stored in repository and are meant to store non-sensitive project configuration, ie. RAILS_ENV or DATABASE_URL.
+
+```yaml
+variables:
+ DATABASE_URL: "postgres://postgres@postgres/my_database"
+```
+
+These variables can be later used in all executed commands and scripts.
+
+The YAML-defined variables are also set to all created service containers, thus allowing to fine tune them.
+
+More information about Docker integration can be found in [Using Docker Images](../docker/using_docker_images.md).
+
### User-defined variables (Secure Variables)
**This feature requires `gitlab-runner` with version equal or greater than 0.4.0.**