README.md 2 KB
Newer Older
Simon Chabot's avatar
Simon Chabot committed
1
2
3
4
5
6
# Logilab's public gitlab-ci templates


In the `templates/` you can find some of our gitlab-ci templates.
You can include them in your gitlab-ci.

7
8
9
10
To include them use this snippet:

```yaml
include:
11
  - project: "open-source/gitlab-ci-templates"
12
    ref: "branch/default"
13
14
15
16
17
18
    file:                                           # the stages are:
      - "templates/no-duplicated-ci-pipelines.yml"  # use workflow to avoid duplicated pipelines
      - "templates/build-docker-image.yml"
      - "templates/build-debian-package.yml"        # will build a .deb and upload it to heptapod
      - "templates/create-release-on-heptapod-including-debian-package.yml"
      - "templates/upload-to-pypi.yml"
19
20
21
22
23
24
25
```

Depending on your templates you will need certains stages **in a specific order**:

```yaml
stages:
  # put your testing/linting stages here before
26
  # for build-debian-package.yml
Simon Chabot's avatar
Simon Chabot committed
27
  - build-debian-package
28
29
  - upload-deb-to-heptapod
  # for build-docker-image.yml
30
31
  # for release-on-heptapod.yml
  - release
32
  # for upload-to-pypi.yml
33
34
35
36
37
38
39
  - publish
```

A recommended configuration for a cube would be:

```yaml
include:
40
  - project: "open-source/gitlab-ci-templates"
41
    ref: "branch/default"
42
43
44
45
46
    file:                                           # the stages are:
      - "templates/no-duplicated-ci-pipelines.yml"  # use workflow to avoid duplicated pipelines
      - "templates/build-debian-package.yml"        # will build a .deb and upload it to heptapod
      - "templates/create-release-on-heptapod-including-debian-package.yml"
      - "templates/upload-to-pypi.yml"
47
48
49

stages:
  - lint
50
  - tests
51
52
  - build-debian-package
  - upload-deb-to-heptapod
53
54
55
56
57
  - 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)
Simon Chabot's avatar
Simon Chabot committed
58
59
60
61
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),
and some examples [here](https://docs.gitlab.com/ee/ci/yaml/README.html#include).