.gitlab-ci.yml 534 Bytes
Newer Older
Amine  GHOZLANE's avatar
Amine GHOZLANE committed
1
2
3
stages:
  - build

Amine  GHOZLANE's avatar
Amine GHOZLANE committed
4
5
6
7
8
9
10
11
services:
  - docker:dind

variables:
  DOCKER_HOST: tcp://localhost:2375


build_master:
Amine  GHOZLANE's avatar
Amine GHOZLANE committed
12
13
14
15
16
  image: docker:latest
  stage: build
  variables:
    CI_DEBUG_TRACE: "false"
  script:
17
18
19
20
21
22
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
    - docker build 
      --cache-from "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
      --tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
      --tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
      .
23
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"