.gitlab-ci.yml 836 Bytes
Newer Older
Sheogorath's avatar
Sheogorath committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
image: quay.io/sheogorath/ubuntu-ci:18.04

services:
  - docker:dind

before_script:
  - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY

build-master:
  stage: build
  variables:
    DOCKER_HOST: "tcp://docker:2375"
    DOH_VERSION: "2.0.1"
  script:
    - docker build --pull --build-arg VERSION="$DOH_VERSION" -t "doh:testing" .
    - ./tools/tagging.sh "$CI_REGISTRY_IMAGE" "${DOH_VERSION:-latest}" ""
    - docker images --format "{{.Repository}}:{{.Tag}}" "$CI_REGISTRY_IMAGE" | xargs -L 1 docker push
  only:
    - master
  tags:
    - docker

build:
  stage: build
  variables:
    DOCKER_HOST: "tcp://docker:2375"
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
  except:
    - master
  tags:
    - docker