Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.51 KiB
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
include:
  - local: templates/Rules.yaml
  - local: templates/Runners/eole-docker.yaml
  - local: templates/Git.yaml
  - local: templates/Docker.yaml
  - local: templates/Semantic-release.yaml

stages:
  - lint
  - build
  - release

.docker-matrix:
  parallel:
    matrix:
      - IMAGE_NAME:
          - commitlint
          - helm
          - semantic-release-gitlab

###############################################################################
# `lint` stage: `commitlint`
###############################################################################
commitlint: {extends: '.git:commitlint'}

###############################################################################
# `build` stage: `*-docker-build`
###############################################################################
# Suffix all jobs to avoid conflict with other jobs names
build-docker:
  extends:
    - .docker-matrix
    - .docker:image:build

###############################################################################
# `release` stage: `new-release`, `tag *`
###############################################################################
# Create the release versions on `$STABLE_BRANCH`
new release: {extends: '.semantic-release:stable'}

# Suffix all jobs to avoid conflict with other jobs names
.tag-docker:
  extends:
    - .docker-matrix
    - .docker:image:tag

## tag contribution branches with a more stable name than `git-${CI_COMMIT_SHORT_SHA}`
tag contrib branch:
  extends:
    - .tag-docker
    - .on-branches
  variables:
    # `feature/foo-bar_quux` → `feature-foo-bar-quux`
    IMAGE_TAG: $CI_COMMIT_REF_SLUG

## dev images
tag dev:
  extends:
    - .tag-docker
    - .on-dev
  variables:
    IMAGE_TAG: dev

## testing images
tag testing:
  extends:
    - .tag-docker