.gitlab-ci.yml 727 Bytes
Newer Older
Amine  GHOZLANE's avatar
Amine GHOZLANE committed
1
stages:
Amine  GHOZLANE's avatar
Amine GHOZLANE committed
2
3
  - build_dev
  - build_master
Amine  GHOZLANE's avatar
Amine GHOZLANE committed
4

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

variables:
  DOCKER_HOST: tcp://localhost:2375


Amine  GHOZLANE's avatar
Amine GHOZLANE committed
12
build_dev:
Amine  GHOZLANE's avatar
Amine GHOZLANE committed
13
  image: docker:latest
Amine  GHOZLANE's avatar
Amine GHOZLANE committed
14
  stage: build_dev
Amine  GHOZLANE's avatar
Amine GHOZLANE committed
15
16
17
  variables:
    CI_DEBUG_TRACE: "false"
  script:
18
19
20
21
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
    - docker build 
      --tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
      .
Amine  GHOZLANE's avatar
Amine GHOZLANE committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
  only:
    - dev

build_master:
  image: docker:latest
  stage: build_master
  variables:
    CI_DEBUG_TRACE: "false"
  script:
    - docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
    - docker build -t aghozlane/shaman .
    - docker push -t aghozlane/shaman
  only:
    - master