services:
  - docker:dind
variables:
  # explicit tag to be used within pipeline
  BUILD_IMAGE_NAME: "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"

  # we also publish a floating tag to simplify manual testing
  BUILD_IMAGE_NAME_LATEST: "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"

  DOCKER_VERSION: 19.03.8

  CI_APPLICATION_TAG: "$CI_COMMIT_SHA"
  CI_APPLICATION_REPOSITORY: "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/$CI_JOB_NAME"

stages:
  - build
  - test
  - release

include:
  - local: .gitlab/ci/build.gitlab-ci.yml
  - local: .gitlab/ci/test.gitlab-ci.yml

