Commit 52898179 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

doc: explain and recommand how to use templates

parent d0c017138497
Pipeline #47455 passed with stage
in 22 seconds
......@@ -4,7 +4,57 @@
In the `templates/` you can find some of our gitlab-ci templates.
You can include them in your gitlab-ci.
See [release-new's gitlab-ci](https://forge.extranet.logilab.fr/open-source/release-new/-/blob/branch/default/.gitlab-ci.yml)
To include them use this snippet:
```yaml
include:
- project: "open-source/gitlab-templates"
ref: "branch/default"
file: # the stages are:
- "templates/no-duplicate-pipelines.yml" # use workflow to avoid duplicated pipelines
- "templates/docker-build.yml" # build a docker image
- "templates/build-debian.yml" # will build a .deb and upload it to heptapod
- "templates/release-on-heptapod.yml" # this will create a release on heptapod AND uses uploaded .deb by build-debian
- "templates/publish-pypi.yml" # this will release on pypi using "tox -e pypi-publish"
```
Depending on your templates you will need certains stages **in a specific order**:
```yaml
stages:
# put your testing/linting stages here before
# for build-debian.yml
- build-debian
- upload-deb
# for docker-build.yml
# for release-on-heptapod.yml
- release
# for publish-pypi.yml
- publish
```
A recommended configuration for a cube would be:
```yaml
include:
- project: "open-source/gitlab-templates"
ref: "branch/default"
file: # the stages are:
- "templates/no-duplicate-pipelines.yml" # use workflow to avoid duplicated pipelines
- "templates/build-debian.yml" # will build a .deb and upload it to heptapod
- "templates/release-on-heptapod.yml" # this will create a release on heptapod AND uses uploaded .deb by build-debian
- "templates/publish-pypi.yml" # this will release on pypi using "tox -e pypi-publish"
stages:
- lint
- test
- build-debian
- upload-deb
- release
- publish
```
You can also refer to [release-new's gitlab-ci](https://forge.extranet.logilab.fr/open-source/release-new/-/blob/branch/default/.gitlab-ci.yml)
for instance, to see how it can be used.
You can also find the official documentation [here](https://docs.gitlab.com/ee/ci/yaml/includes.html),
......
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