summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-09-07 22:26:21 +0200
committerMatija Čupić <matteeyah@gmail.com>2018-09-07 22:26:21 +0200
commitc6f4647c353ba0bc6cf82ec79b58fc3f926786b2 (patch)
treec62ee2a545b097979872bb9fe75db262d420aa84
parent1e816a972164c515bf99c39bd8880dd23e534c9e (diff)
downloadgitlab-ce-c6f4647c353ba0bc6cf82ec79b58fc3f926786b2.tar.gz
Update yaml documentation examples
CE mirror of b8d12ec36b50fdae966361b4d6acc4791ef1830c
-rw-r--r--doc/ci/yaml/README.md76
1 files changed, 50 insertions, 26 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index cf20f763a34..d5c3400073a 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -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:
```yaml
-# Content of http://company.com/ruby-autodeploy-template.yml
+# Content of http://company.com/autodevops-template.yml
variables:
- KUBE_DOMAIN: example.com
-
-build:
- stage: build
+ POSTGRES_USER: user
+ POSTGRES_PASSWORD: testing_password
+ POSTGRES_ENABLED: "true"
+ POSTGRES_DB: $CI_ENVIRONMENT_SLUG
+ KUBERNETES_VERSION: 1.8.6
+ HELM_VERSION: 2.6.1
+ CODECLIMATE_VERSION: 0.69.0
+
+production:
+ stage: production
script:
- - command build
- only:
- - master
-
-deploy:
- stage: deploy
- script:
- - command deploy
+ - check_kube_domain
+ - install_dependencies
+ - download_chart
+ - ensure_namespace
+ - install_tiller
+ - create_secret
+ - deploy
+ - delete canary
+ - persist_environment_url
environment:
name: production
- url: http://production.example.com
+ url: http://$CI_PROJECT_PATH_SLUG.$AUTO_DEVOPS_DOMAIN
only:
- - master
+ refs:
+ - master
+ kubernetes: active
```
-
```yaml
# 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:
- KUBE_DOMAIN: gitlab.domain.com
+ POSTGRES_USER: root
+ POSTGRES_PASSWORD: secure_password
+ POSTGRES_DB: company_database
stages:
- build
- - deploy
+ - test
+ - review
+ - dast
+ - staging
+ - canary
+ - production
+ - performance
+ - cleanup
-deploy:
- stage: deploy
+production:
+ stage: production
script:
- - command deploy
+ - check_kube_domain
+ - install_dependencies
+ - download_chart
+ - ensure_namespace
+ - install_tiller
+ - create_secret
+ - deploy
environment:
name: production
- url: http://gitlab.com
+ url: http://auto_devops_domain.com
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`