image: docker:latest
services:
  - docker:dind

stages:
  - build

before_script:
  - docker info
  - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
  - apk -U add make

.build_job: &build_job
  stage: build
  tags:
    - docker-build
  script:
    - make -C ${CI_JOB_NAME}
    - '[ "$CI_COMMIT_REF_NAME" != master ] || make -C ${CI_JOB_NAME} push'

'15.1':
  <<: *build_job
