.gitlab-ci.yml 465 Bytes
Newer Older
Torstein Leversund's avatar
Torstein Leversund committed
1
image: docker:19.03.1
2
3
4
5
6
7
8
9
10
11

stages:
- build

before_script:
   - echo -n $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY

build:
  stage: build
  script:
Torstein Leversund's avatar
Torstein Leversund committed
12
13
14
15
16
    - docker pull $CI_REGISTRY_IMAGE:latest || true
    - docker build --cache-from $CI_REGISTRY_IMAGE:latest
      --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest .
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
    - docker push $CI_REGISTRY_IMAGE:latest