Commit c6f4647c authored by Matija Čupić's avatar Matija Čupić

Update yaml documentation examples

CE mirror of b8d12ec36b50fdae966361b4d6acc4791ef1830c
parent 1e816a97
...@@ -1032,56 +1032,80 @@ are both valid use cases. ...@@ -1032,56 +1032,80 @@ are both valid use cases.
- Since external files defined on `include` are evaluated first, the content on `gitlab-ci.yml` **will always take precedence over the content of the external files, no matters of the position of the `include` keyword, allowing to override values and functions with local definitions**, for example: - Since external files defined on `include` are evaluated first, the content on `gitlab-ci.yml` **will always take precedence over the content of the external files, no matters of the position of the `include` keyword, allowing to override values and functions with local definitions**, for example:
```yaml ```yaml
# Content of http://company.com/ruby-autodeploy-template.yml # Content of http://company.com/autodevops-template.yml
variables: variables:
KUBE_DOMAIN: example.com POSTGRES_USER: user
POSTGRES_PASSWORD: testing_password
build: POSTGRES_ENABLED: "true"
stage: build POSTGRES_DB: $CI_ENVIRONMENT_SLUG
KUBERNETES_VERSION: 1.8.6
HELM_VERSION: 2.6.1
CODECLIMATE_VERSION: 0.69.0
production:
stage: production
script: script:
- command build - check_kube_domain
only: - install_dependencies
- master - download_chart
- ensure_namespace
deploy: - install_tiller
stage: deploy - create_secret
script: - deploy
- command deploy - delete canary
- persist_environment_url
environment: environment:
name: production name: production
url: http://production.example.com url: http://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN
only: only:
- master refs:
- master
kubernetes: active
``` ```
```yaml ```yaml
# Content of gitlab-ci.yml # Content of gitlab-ci.yml
include: 'http://company.com/ruby-autodeploy-template.yml' include: 'https://company.com/autodevops-template.yml'
image: registry.gitlab.com/gitlab-examples/kubernetes-deploy image: alpine:latest
variables: variables:
KUBE_DOMAIN: gitlab.domain.com POSTGRES_USER: root
POSTGRES_PASSWORD: secure_password
POSTGRES_DB: company_database
stages: stages:
- build - build
- deploy - test
- review
- dast
- staging
- canary
- production
- performance
- cleanup
deploy: production:
stage: deploy stage: production
script: script:
- command deploy - check_kube_domain
- install_dependencies
- download_chart
- ensure_namespace
- install_tiller
- create_secret
- deploy
environment: environment:
name: production name: production
url: http://gitlab.com url: http://auto_devops_domain.com
only: only:
- master refs:
- master
``` ```
In this case, the variable `KUBE_DOMAIN` and the `deploy` job defined on `ruby-autodeploy-template.yml` will override by the ones defined on `gitlab-ci.yml`. In this case, the variables `POSTGRES_USER`, `POSTGRES_PASSWORD` and `POSTGRES_DB` along with the `production` job defined on `autodevops-template.yml` will be overridden by the ones defined on `gitlab-ci.yml`.
## `artifacts` ## `artifacts`
......
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