Skip to content
Snippets Groups Projects
Commit 528981799846 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

doc: explain and recommand how to use templates

parent d0c017138497
No related branches found
No related tags found
1 merge request!1doc: explain and recommand how to use templates
Pipeline #47455 passed
...@@ -4,7 +4,57 @@ ...@@ -4,7 +4,57 @@
In the `templates/` you can find some of our gitlab-ci templates. In the `templates/` you can find some of our gitlab-ci templates.
You can include them in your gitlab-ci. 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. 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), You can also find the official documentation [here](https://docs.gitlab.com/ee/ci/yaml/includes.html),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment